summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/bintool.py10
-rw-r--r--tools/mips-relocs.c7
2 files changed, 13 insertions, 4 deletions
diff --git a/tools/binman/bintool.py b/tools/binman/bintool.py
index 81872db377f..9c76c8881a4 100644
--- a/tools/binman/bintool.py
+++ b/tools/binman/bintool.py
@@ -55,6 +55,9 @@ class Bintool:
# must be called before this class is used.
tooldir = ''
+ # Flag to run 'apt-get update -y' once on first use of apt_install()
+ apt_updated = False
+
def __init__(self, name, desc, version_regex=None, version_args='-V'):
self.name = name
self.desc = desc
@@ -421,7 +424,12 @@ class Bintool:
Returns:
True, assuming it completes without error
"""
- args = ['sudo', 'apt', 'install', '-y', package]
+ if not cls.apt_updated:
+ args = ['sudo', 'apt-get', 'update', '-y']
+ print('- %s' % ' '.join(args))
+ tools.run(*args)
+ cls.apt_updated = True
+ args = ['sudo', 'apt-get', 'install', '-y', package]
print('- %s' % ' '.join(args))
tools.run(*args)
return True
diff --git a/tools/mips-relocs.c b/tools/mips-relocs.c
index 5db610f5c77..e9234a74f51 100644
--- a/tools/mips-relocs.c
+++ b/tools/mips-relocs.c
@@ -9,6 +9,7 @@
#include <elf.h>
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
@@ -272,7 +273,7 @@ int main(int argc, char *argv[])
if (ehdr_field(e_type) != ET_EXEC) {
fprintf(stderr, "Input ELF is not an executable\n");
- printf("type 0x%lx\n", ehdr_field(e_type));
+ printf("type 0x%" PRIx64 "\n", ehdr_field(e_type));
err = -EINVAL;
goto out_free_relocs;
}
@@ -394,9 +395,9 @@ int main(int argc, char *argv[])
rel_size = shdr_field(i_rel_shdr, sh_size);
rel_actual_size = buf - buf_start;
if (rel_actual_size > rel_size) {
- fprintf(stderr, "Relocations overflow available space of 0x%lx (required 0x%lx)!\n",
+ fprintf(stderr, "Relocations overflow available space of 0x%zx (required 0x%zx)!\n",
rel_size, rel_actual_size);
- fprintf(stderr, "Please adjust CONFIG_MIPS_RELOCATION_TABLE_SIZE to at least 0x%lx\n",
+ fprintf(stderr, "Please adjust CONFIG_MIPS_RELOCATION_TABLE_SIZE to at least 0x%zx\n",
(rel_actual_size + 0x100) & ~0xFF);
err = -ENOMEM;
goto out_free_relocs;