aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/builderthread.py4
-rw-r--r--tools/buildman/control.py28
-rw-r--r--tools/buildman/func_test.py9
-rw-r--r--tools/buildman/toolchain.py6
-rw-r--r--tools/libfdt/fdt_rw.c2
-rw-r--r--tools/logos/u-boot_logo.bmpbin0 -> 25738 bytes
-rw-r--r--tools/logos/u-boot_logo.svg248
7 files changed, 290 insertions, 7 deletions
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index fa9dec043a..0efe80d945 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -6,6 +6,7 @@ import errno
import glob
import os
import shutil
+import sys
import threading
import command
@@ -26,6 +27,9 @@ def Mkdir(dirname, parents = False):
os.mkdir(dirname)
except OSError as err:
if err.errno == errno.EEXIST:
+ if os.path.realpath('.') == os.path.realpath(dirname):
+ print "Cannot create the current working directory '%s'!" % dirname
+ sys.exit(1)
pass
else:
raise
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index c14b87842d..4ac4386db6 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -80,6 +80,28 @@ def ShowActions(series, why_selected, boards_selected, builder, options):
print ('Total boards to build for each commit: %d\n' %
len(why_selected['all']))
+def CheckOutputDir(output_dir):
+ """Make sure that the output directory is not within the current directory
+
+ If we try to use an output directory which is within the current directory
+ (which is assumed to hold the U-Boot source) we may end up deleting the
+ U-Boot source code. Detect this and print an error in this case.
+
+ Args:
+ output_dir: Output directory path to check
+ """
+ path = os.path.realpath(output_dir)
+ cwd_path = os.path.realpath('.')
+ while True:
+ if os.path.realpath(path) == cwd_path:
+ Print("Cannot use output directory '%s' since it is within the current directtory '%s'" %
+ (path, cwd_path))
+ sys.exit(1)
+ parent = os.path.dirname(path)
+ if parent == path:
+ break
+ path = parent
+
def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
clean_dir=False):
"""The main control code for buildman
@@ -251,9 +273,9 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
# output directory itself rather than any subdirectory.
if not options.no_subdirs:
output_dir = os.path.join(options.output_dir, dirname)
- if (clean_dir and output_dir != options.output_dir and
- os.path.exists(output_dir)):
- shutil.rmtree(output_dir)
+ if clean_dir and os.path.exists(output_dir):
+ shutil.rmtree(output_dir)
+ CheckOutputDir(output_dir)
builder = Builder(toolchains, output_dir, options.git_dir,
options.threads, options.jobs, gnu_make=gnu_make, checkout=True,
show_unknown=options.show_unknown, step=options.step,
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index 8d96c1a94d..9206fb299d 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -519,3 +519,12 @@ class TestFunctional(unittest.TestCase):
self._RunControl('-b', self._test_branch, clean_dir=False)
self.assertEqual(self._builder.count, self._total_builds)
self.assertEqual(self._builder.fail, 0)
+
+ def testBadOutputDir(self):
+ """Test building with an output dir the same as out current dir"""
+ self._test_branch = '/__dev/__testbranch'
+ with self.assertRaises(SystemExit):
+ self._RunControl('-b', self._test_branch, '-o', os.getcwd())
+ with self.assertRaises(SystemExit):
+ self._RunControl('-b', self._test_branch, '-o',
+ os.path.join(os.getcwd(), 'test'))
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index fb3157b2ea..4b35f400e9 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -32,7 +32,7 @@ class MyHTMLParser(HTMLParser):
HTMLParser.__init__(self)
self.arch_link = None
self.links = []
- self._match = '_%s-' % arch
+ self.re_arch = re.compile('[-_]%s-' % arch)
def handle_starttag(self, tag, attrs):
if tag == 'a':
@@ -40,7 +40,7 @@ class MyHTMLParser(HTMLParser):
if tag == 'href':
if value and value.endswith('.xz'):
self.links.append(value)
- if self._match in value:
+ if self.re_arch.search(value):
self.arch_link = value
@@ -430,7 +430,7 @@ class Toolchains:
"""
arch = command.OutputOneLine('uname', '-m')
base = 'https://www.kernel.org/pub/tools/crosstool/files/bin'
- versions = ['4.9.0', '4.6.3', '4.6.2', '4.5.1', '4.2.4']
+ versions = ['7.3.0', '6.4.0', '4.9.4']
links = []
for version in versions:
url = '%s/%s/%s/' % (base, arch, version)
diff --git a/tools/libfdt/fdt_rw.c b/tools/libfdt/fdt_rw.c
index e475084fae..68fc7c8c88 100644
--- a/tools/libfdt/fdt_rw.c
+++ b/tools/libfdt/fdt_rw.c
@@ -25,7 +25,7 @@ int fdt_remove_unused_strings(const void *old, void *new)
new_prop = (struct fdt_property *)(unsigned long)
fdt_get_property_by_offset(new, offset, NULL);
str = fdt_string(old, fdt32_to_cpu(old_prop->nameoff));
- ret = _fdt_find_add_string(new, str);
+ ret = fdt_find_add_string_(new, str);
if (ret < 0)
return ret;
new_prop->nameoff = cpu_to_fdt32(ret);
diff --git a/tools/logos/u-boot_logo.bmp b/tools/logos/u-boot_logo.bmp
new file mode 100644
index 0000000000..40245dd40d
--- /dev/null
+++ b/tools/logos/u-boot_logo.bmp
Binary files differ
diff --git a/tools/logos/u-boot_logo.svg b/tools/logos/u-boot_logo.svg
new file mode 100644
index 0000000000..e45ef2ef77
--- /dev/null
+++ b/tools/logos/u-boot_logo.svg
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
+
+<!-- Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de> -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="186"
+ height="186"
+ viewBox="0 0 186 186"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="u-boot_logo.svg"
+ inkscape:export-filename="tools/logos/u-boot_logo.png"
+ inkscape:export-xdpi="41.290001"
+ inkscape:export-ydpi="41.290001">
+ <title
+ id="title30">U-Boot Logo</title>
+ <metadata
+ id="metadata31">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>U-Boot Logo</dc:title>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:date>May 21st, 2018</dc:date>
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Notice" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Attribution" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs29" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1440"
+ inkscape:window-height="871"
+ id="namedview27"
+ showgrid="false"
+ inkscape:zoom="3"
+ inkscape:cx="93"
+ inkscape:cy="93"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1" />
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,0)">
+ <rect
+ style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0"
+ id="rect31"
+ width="186"
+ height="186"
+ x="0"
+ y="0" />
+ <circle
+ style="fill:#004466;fill-opacity:1;stroke-width:0;stroke:none"
+ id="path835"
+ cx="93"
+ cy="93"
+ r="93" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#ffcc88;fill-opacity:1;stroke:none;stroke-width:0;stroke:none"
+ d="m 116,76 a 20,20 0 0 1 -20,-20 20,20 0 0 1 20,-20 v 11 a 9,9 0 0 0 -9,9 9,9 0 0 0 9,9 z"
+ id="path4136-6-6-1-6-3-5" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#ffcc88;fill-opacity:1;stroke:none;stroke-width:0"
+ d="m 116,66 a 10,10 0 0 1 -10,-10 10,10 0 0 1 10,-10 v 1 a 9,9 0 0 0 -9,9 9,9 0 0 0 9,9 z"
+ id="path4136-6-6-1-6-3-5-1-9" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4136-6-6-1-6-3-5-1-2"
+ cx="116"
+ cy="41.5"
+ rx="4"
+ ry="5.5" />
+ <circle
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4352"
+ cx="86"
+ cy="66"
+ r="10" />
+ <circle
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4352-1"
+ cx="126"
+ cy="66"
+ r="10" />
+ <rect
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="rect4399"
+ width="39"
+ height="20"
+ x="86.5"
+ y="56" />
+ <rect
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="rect4660"
+ width="60"
+ height="9.5"
+ x="76"
+ y="66.5" />
+ <circle
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4549-5"
+ cx="36"
+ cy="81"
+ r="15" />
+ <circle
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4549-5-5"
+ cx="36"
+ cy="121"
+ r="15" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:#000000;stroke-width:0"
+ id="path4136-6-6"
+ cx="15"
+ cy="91"
+ rx="4"
+ ry="10" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:#000000;stroke-width:0"
+ id="path4136-6-6-1"
+ cx="15"
+ cy="111"
+ rx="4"
+ ry="10" />
+ <rect
+ style="fill:#dd9955;fill-opacity:1;stroke:#000000;stroke-width:0"
+ id="rect4213"
+ width="65"
+ height="4"
+ x="11"
+ y="99" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:#000000;stroke-width:0"
+ id="path4136"
+ cx="100.5"
+ cy="100.5"
+ rx="74.5"
+ ry="34.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416"
+ cx="70"
+ cy="95.5"
+ rx="15"
+ ry="12.5" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-9"
+ cx="70"
+ cy="95.5"
+ rx="14"
+ ry="11.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-0"
+ cx="70"
+ cy="95.5"
+ rx="11"
+ ry="8.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-94"
+ cx="110"
+ cy="95.5"
+ rx="15"
+ ry="12.5" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-9-1"
+ cx="110"
+ cy="95.5"
+ rx="14"
+ ry="11.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-0-1"
+ cx="110"
+ cy="95.5"
+ rx="11"
+ ry="8.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-94-2"
+ cx="150"
+ cy="95.5"
+ rx="15"
+ ry="12.5" />
+ <ellipse
+ style="fill:#ffcc88;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-9-1-2"
+ cx="150"
+ cy="95.5"
+ rx="14"
+ ry="11.5" />
+ <ellipse
+ style="fill:#dd9955;fill-opacity:1;stroke:none;stroke-width:0"
+ id="path4416-0-1-9"
+ cx="150"
+ cy="95.5"
+ rx="11"
+ ry="8.5" />
+ </g>
+</svg>