mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
binman: Get futility by building it
A binary download is not great, since it depends on libraries being present in the system. Build futility from source instead. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
13982ced2c
commit
d64af08f19
2 changed files with 20 additions and 7 deletions
|
@ -319,7 +319,7 @@ class Bintool:
|
||||||
return result.stdout
|
return result.stdout
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def build_from_git(cls, git_repo, make_target, bintool_path):
|
def build_from_git(cls, git_repo, make_target, bintool_path, flags=None):
|
||||||
"""Build a bintool from a git repo
|
"""Build a bintool from a git repo
|
||||||
|
|
||||||
This clones the repo in a temporary directory, builds it with 'make',
|
This clones the repo in a temporary directory, builds it with 'make',
|
||||||
|
@ -330,6 +330,7 @@ class Bintool:
|
||||||
make_target (str): Target to pass to 'make' to build the tool
|
make_target (str): Target to pass to 'make' to build the tool
|
||||||
bintool_path (str): Relative path of the tool in the repo, after
|
bintool_path (str): Relative path of the tool in the repo, after
|
||||||
build is complete
|
build is complete
|
||||||
|
flags (list of str): Flags or variables to pass to make, or None
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
tuple:
|
tuple:
|
||||||
|
@ -341,8 +342,11 @@ class Bintool:
|
||||||
print(f"- clone git repo '{git_repo}' to '{tmpdir}'")
|
print(f"- clone git repo '{git_repo}' to '{tmpdir}'")
|
||||||
tools.run('git', 'clone', '--depth', '1', git_repo, tmpdir)
|
tools.run('git', 'clone', '--depth', '1', git_repo, tmpdir)
|
||||||
print(f"- build target '{make_target}'")
|
print(f"- build target '{make_target}'")
|
||||||
tools.run('make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
|
cmd = ['make', '-C', tmpdir, '-j', f'{multiprocessing.cpu_count()}',
|
||||||
make_target)
|
make_target]
|
||||||
|
if flags:
|
||||||
|
cmd += flags
|
||||||
|
tools.run(*cmd)
|
||||||
fname = os.path.join(tmpdir, bintool_path)
|
fname = os.path.join(tmpdir, bintool_path)
|
||||||
if not os.path.exists(fname):
|
if not os.path.exists(fname):
|
||||||
print(f"- File '{fname}' was not produced")
|
print(f"- File '{fname}' was not produced")
|
||||||
|
|
|
@ -160,8 +160,17 @@ class Bintoolfutility(bintool.Bintool):
|
||||||
Raises:
|
Raises:
|
||||||
Valuerror: Fetching could not be completed
|
Valuerror: Fetching could not be completed
|
||||||
"""
|
"""
|
||||||
if method != bintool.FETCH_BIN:
|
if method != bintool.FETCH_BUILD:
|
||||||
return None
|
return None
|
||||||
fname, tmpdir = self.fetch_from_drive(
|
|
||||||
'1hdsInzsE4aJbmBeJ663kYgjOQyW1I-E0')
|
# The Chromium OS repo is here:
|
||||||
return fname, tmpdir
|
# https://chromium.googlesource.com/chromiumos/platform/vboot_reference/
|
||||||
|
#
|
||||||
|
# Unfortunately this requires logging in and obtaining a line for the
|
||||||
|
# .gitcookies file. So use a mirror instead.
|
||||||
|
result = self.build_from_git(
|
||||||
|
'https://github.com/sjg20/vboot_reference.git',
|
||||||
|
'all',
|
||||||
|
'build/futility/futility',
|
||||||
|
flags=['USE_FLASHROM=0'])
|
||||||
|
return result
|
||||||
|
|
Loading…
Add table
Reference in a new issue