mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
binman: btool: mkimage: use Bintool.version
Bintool.version already contains everything required to get the version out of mkimage binary so let's not override it with its own implementation. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Simon Glass
parent
f17219ad42
commit
65e2c14d5a
@@ -18,11 +18,11 @@ class Bintoolmkimage(bintool.Bintool):
|
|||||||
Support is provided for fetching this on Debian-like systems, using apt.
|
Support is provided for fetching this on Debian-like systems, using apt.
|
||||||
"""
|
"""
|
||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
super().__init__(name, 'Generate image for U-Boot')
|
super().__init__(name, 'Generate image for U-Boot', r'mkimage version (.*)')
|
||||||
|
|
||||||
# pylint: disable=R0913
|
# pylint: disable=R0913
|
||||||
def run(self, reset_timestamp=False, output_fname=None, external=False,
|
def run(self, reset_timestamp=False, output_fname=None, external=False,
|
||||||
pad=None, version=False):
|
pad=None):
|
||||||
"""Run mkimage
|
"""Run mkimage
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -44,8 +44,6 @@ class Bintoolmkimage(bintool.Bintool):
|
|||||||
args.append('-t')
|
args.append('-t')
|
||||||
if output_fname:
|
if output_fname:
|
||||||
args += ['-F', output_fname]
|
args += ['-F', output_fname]
|
||||||
if version:
|
|
||||||
args.append('-V')
|
|
||||||
return self.run_cmd(*args)
|
return self.run_cmd(*args)
|
||||||
|
|
||||||
def fetch(self, method):
|
def fetch(self, method):
|
||||||
@@ -66,15 +64,3 @@ class Bintoolmkimage(bintool.Bintool):
|
|||||||
if method != bintool.FETCH_BIN:
|
if method != bintool.FETCH_BIN:
|
||||||
return None
|
return None
|
||||||
return self.apt_install('u-boot-tools')
|
return self.apt_install('u-boot-tools')
|
||||||
|
|
||||||
def version(self):
|
|
||||||
"""Version handler for mkimage
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
str: Version string for mkimage
|
|
||||||
"""
|
|
||||||
out = self.run(version=True).strip()
|
|
||||||
if not out:
|
|
||||||
return super().version()
|
|
||||||
m_version = re.match(r'mkimage version (.*)', out)
|
|
||||||
return m_version.group(1) if m_version else out
|
|
||||||
|
|||||||
Reference in New Issue
Block a user