1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-25 05:57:51 +00:00

target: Add method to install device modules after initial setup

Allow for installing additional device modules once a target has already
been initialized.
This commit is contained in:
Marc Bonnici 2019-10-21 17:58:32 +01:00
parent c5d06ee3d6
commit 249b8336b5

View File

@ -796,6 +796,18 @@ class Target(object):
strip_null_chars)
return _build_path_tree(value_map, path, self.path.sep, dictcls)
def install_module(self, mod, **params):
mod = get_module(mod)
if mod.stage == 'early':
msg = 'Module {} cannot be installed after device setup has already occoured.'
raise TargetStableError(msg)
if mod.probe(self):
self._install_module(mod, **params)
else:
msg = 'Module {} is not supported by the target'.format(mod.name)
raise TargetStableError(msg)
# internal methods
def _setup_shutils(self):