summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-08-23 16:06:38 -0400
committerTom Rini <trini@konsulko.com>2020-08-23 16:06:38 -0400
commitd584648dad691caec3ecc7777dbfa3f1936878e5 (patch)
treeee787f8204c917526859da55840f6f159a00b8ba /tools
parentc84341f5acd6140f361300f02b354a7238f95b72 (diff)
parenta4020350289c520e896fd6180e510be557ed3bf9 (diff)
Merge tag 'dm-pull-22aug20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
replace devfdt_get_addr_ptr() with dev_read_addr_ptr() binman fixes for portage various minor fixes 'bind' command improvements
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/control.py17
-rw-r--r--tools/binman/ftest.py7
-rw-r--r--tools/binman/image_test.py2
-rwxr-xr-xtools/binman/main.py17
-rw-r--r--tools/binman/setup.py12
-rw-r--r--tools/dtoc/setup.py12
6 files changed, 45 insertions, 22 deletions
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 343b0a0c35..60e89d3776 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -6,6 +6,7 @@
#
from collections import OrderedDict
+import glob
import os
import sys
from patman import tools
@@ -51,6 +52,18 @@ def _FindBinmanNode(dtb):
return node
return None
+def GetEntryModules(include_testing=True):
+ """Get a set of entry class implementations
+
+ Returns:
+ Set of paths to entry class filenames
+ """
+ our_path = os.path.dirname(os.path.realpath(__file__))
+ glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
+ return set([os.path.splitext(os.path.basename(item))[0]
+ for item in glob_list
+ if include_testing or '_testing' not in item])
+
def WriteEntryDocs(modules, test_missing=None):
"""Write out documentation for all entries
@@ -110,7 +123,7 @@ def ReadEntry(image_fname, entry_path, decomp=True):
data extracted from the entry
"""
global Image
- from image import Image
+ from binman.image import Image
image = Image.FromFile(image_fname)
entry = image.FindEntryPath(entry_path)
@@ -483,7 +496,7 @@ def Binman(args):
return 0
# Put these here so that we can import this module without libfdt
- from image import Image
+ from binman.image import Image
from binman import state
if args.cmd in ['ls', 'extract', 'replace']:
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index bf7f59fb84..5f650b5f94 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -24,13 +24,12 @@ from binman import control
from binman import elf
from binman import elf_test
from binman import fmap_util
-from binman import main
from binman import state
from dtoc import fdt
from dtoc import fdt_util
from binman.etype import fdtmap
from binman.etype import image_header
-from image import Image
+from binman.image import Image
from patman import command
from patman import test_util
from patman import tools
@@ -1440,14 +1439,14 @@ class TestFunctional(unittest.TestCase):
def testEntryDocs(self):
"""Test for creation of entry documentation"""
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(main.GetEntryModules())
+ control.WriteEntryDocs(control.GetEntryModules())
self.assertTrue(len(stdout.getvalue()) > 0)
def testEntryDocsMissing(self):
"""Test handling of missing entry documentation"""
with self.assertRaises(ValueError) as e:
with test_util.capture_sys_output() as (stdout, stderr):
- control.WriteEntryDocs(main.GetEntryModules(), 'u_boot')
+ control.WriteEntryDocs(control.GetEntryModules(), 'u_boot')
self.assertIn('Documentation is missing for modules: u_boot',
str(e.exception))
diff --git a/tools/binman/image_test.py b/tools/binman/image_test.py
index f85c3c51c0..e351fa84ab 100644
--- a/tools/binman/image_test.py
+++ b/tools/binman/image_test.py
@@ -6,7 +6,7 @@
import unittest
-from image import Image
+from binman.image import Image
from patman.test_util import capture_sys_output
class TestImage(unittest.TestCase):
diff --git a/tools/binman/main.py b/tools/binman/main.py
index e543a7d06a..8c1e478d54 100755
--- a/tools/binman/main.py
+++ b/tools/binman/main.py
@@ -10,7 +10,6 @@
"""See README for more information"""
from distutils.sysconfig import get_python_lib
-import glob
import os
import site
import sys
@@ -62,7 +61,6 @@ def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
from binman import fdt_test
from binman import ftest
from binman import image_test
- from binman import test
import doctest
result = unittest.TestResult()
@@ -78,20 +76,9 @@ def RunTests(debug, verbosity, processes, test_preserve_dirs, args, toolpath):
return test_util.ReportResult('binman', test_name, result)
-def GetEntryModules(include_testing=True):
- """Get a set of entry class implementations
-
- Returns:
- Set of paths to entry class filenames
- """
- glob_list = glob.glob(os.path.join(our_path, 'etype/*.py'))
- return set([os.path.splitext(os.path.basename(item))[0]
- for item in glob_list
- if include_testing or '_testing' not in item])
-
def RunTestCoverage(toolpath):
"""Run the tests and check that we get 100% coverage"""
- glob_list = GetEntryModules(False)
+ glob_list = control.GetEntryModules(False)
all_set = set([os.path.splitext(os.path.basename(item))[0]
for item in glob_list if '_testing' not in item])
extra_args = ''
@@ -127,7 +114,7 @@ def RunBinman(args):
args.toolpath)
elif args.cmd == 'entry-docs':
- control.WriteEntryDocs(GetEntryModules())
+ control.WriteEntryDocs(control.GetEntryModules())
else:
try:
diff --git a/tools/binman/setup.py b/tools/binman/setup.py
new file mode 100644
index 0000000000..fe408ed691
--- /dev/null
+++ b/tools/binman/setup.py
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+from distutils.core import setup
+setup(name='binman',
+ version='1.0',
+ license='GPL-2.0+',
+ scripts=['binman'],
+ packages=['binman', 'binman.etype'],
+ package_dir={'binman': ''},
+ package_data={'binman': ['README', 'README.entries']},
+ classifiers=['Environment :: Console',
+ 'Topic :: Software Development :: Embedded Systems'])
diff --git a/tools/dtoc/setup.py b/tools/dtoc/setup.py
new file mode 100644
index 0000000000..5e092fe087
--- /dev/null
+++ b/tools/dtoc/setup.py
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+from distutils.core import setup
+setup(name='dtoc',
+ version='1.0',
+ license='GPL-2.0+',
+ scripts=['dtoc'],
+ packages=['dtoc'],
+ package_dir={'dtoc': ''},
+ package_data={'dtoc': ['README']},
+ classifiers=['Environment :: Console',
+ 'Topic :: Software Development :: Embedded Systems'])