Exemplo n.º 1
0
 def __init__(self, section, etype, node):
     Entry.__init__(self, section, etype, node)
     label, = self.GetEntryArgsOrProps([EntryArg('text-label', str)])
     self.text_label = tools.ToStr(label) if type(label) != str else label
     value, = self.GetEntryArgsOrProps([EntryArg(self.text_label, str)])
     value = tools.ToBytes(value) if value is not None else value
     self.value = value
Exemplo n.º 2
0
 def __init__(self, section, etype, node):
     Entry.__init__(self, section, etype, node)
     self.text_label, = self.GetEntryArgsOrProps(
         [EntryArg('text-label', str)])
     self.value, = self.GetEntryArgsOrProps(
         [EntryArg(self.text_label, str)])
     if not self.value:
         self.Raise("No value provided for text label '%s'" %
                    self.text_label)
Exemplo n.º 3
0
 def __init__(self, section, etype, node):
     Entry.__init__(self, section, etype, node)
     value = fdt_util.GetString(self._node, 'text')
     if value:
         value = tools.ToBytes(value)
     else:
         label, = self.GetEntryArgsOrProps([EntryArg('text-label', str)])
         self.text_label = label
         if self.text_label:
             value, = self.GetEntryArgsOrProps([EntryArg(self.text_label,
                                                         str)])
             value = tools.ToBytes(value) if value is not None else value
     self.value = value
Exemplo n.º 4
0
    def __init__(self, section, etype, node):
        Entry.__init__(self, section, etype, node)
        self.hardware_id, self.keydir, self.bmpblk = self.GetEntryArgsOrProps([
            EntryArg('hardware-id', str),
            EntryArg('keydir', str),
            EntryArg('bmpblk', str)
        ])

        # Read in the GBB flags from the config
        self.gbb_flags = 0
        flags_node = node.FindNode('flags')
        if flags_node:
            for flag, value in gbb_flag_properties.iteritems():
                if fdt_util.GetBool(flags_node, flag):
                    self.gbb_flags |= value
Exemplo n.º 5
0
    def __init__(self, section, etype, node):
        Entry.__init__(self, section, etype, node)
        self.return_invalid_entry = fdt_util.GetBool(self._node,
                                                     'return-invalid-entry')
        self.return_unknown_contents = fdt_util.GetBool(
            self._node, '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
        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)])
        self.return_contents = True
Exemplo n.º 6
0
 def __init__(self, section, etype, node):
     Entry.__init__(self, section, etype, node)
     self.content = fdt_util.GetPhandleList(self._node, 'content')
     if not self.content:
         self.Raise("Vblock must have a 'content' property")
     (self.keydir, self.keyblock, self.signprivate, self.version,
      self.kernelkey, self.preamble_flags) = self.GetEntryArgsOrProps([
         EntryArg('keydir', str),
         EntryArg('keyblock', str),
         EntryArg('signprivate', str),
         EntryArg('version', int),
         EntryArg('kernelkey', str),
         EntryArg('preamble-flags', int)])
Exemplo n.º 7
0
 def __init__(self, section, etype, node):
     Entry.__init__(self, section, etype, node)
     self.text_label, = self.GetEntryArgsOrProps(
         [EntryArg('text-label', str)])
     self.value, = self.GetEntryArgsOrProps(
         [EntryArg(self.text_label, str)])
Exemplo n.º 8
0
 def __init__(self, section, etype, node, blob_fname):
     Entry_blob.__init__(self, section, etype, node)
     self._filename, = self.GetEntryArgsOrProps(
         [EntryArg('%s-path' % blob_fname, str)])