Update buildroot 2020.02.01 (#622)

* Update buildroot 2020.02.01

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix LN

* Fix wpa

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix lint

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* fix-network

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>

* Fix script

Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
This commit is contained in:
Pascal Vizeli
2020-04-16 20:03:01 +02:00
committed by GitHub
parent 0c2b5aff65
commit 5a6678147e
6201 changed files with 73436 additions and 70757 deletions

View File

@@ -3,9 +3,11 @@ import re
import sys
import tempfile
import subprocess
from urllib2 import urlopen, HTTPError, URLError
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
ARTIFACTS_URL = "http://autobuild.buildroot.net/artefacts/"
BASE_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), "../../.."))
def open_log_file(builddir, stage, logtofile=True):
@@ -21,8 +23,13 @@ def open_log_file(builddir, stage, logtofile=True):
return fhandle
def basepath(relpath=""):
"""Return the absolute path for a file or directory relative to the Buildroot top directory."""
return os.path.join(BASE_DIR, relpath)
def filepath(relpath):
return os.path.join(os.getcwd(), "support/testing", relpath)
return os.path.join(BASE_DIR, "support/testing", relpath)
def download(dldir, filename):
@@ -38,7 +45,7 @@ def download(dldir, filename):
try:
url_fh = urlopen(os.path.join(ARTIFACTS_URL, filename))
with open(tmpfile, "w+") as tmpfile_fh:
with open(tmpfile, "w+b") as tmpfile_fh:
tmpfile_fh.write(url_fh.read())
except (HTTPError, URLError) as err:
os.unlink(tmpfile)
@@ -49,6 +56,16 @@ def download(dldir, filename):
return finalpath
def run_cmd_on_host(builddir, cmd):
"""Call subprocess.check_output and return the text output."""
out = subprocess.check_output(cmd,
stderr=open(os.devnull, "w"),
cwd=builddir,
env={"LANG": "C"},
universal_newlines=True)
return out
def get_elf_arch_tag(builddir, prefix, fpath, tag):
"""
Runs the cross readelf on 'fpath', then extracts the value of tag 'tag'.
@@ -60,7 +77,7 @@ def get_elf_arch_tag(builddir, prefix, fpath, tag):
"""
cmd = ["host/bin/{}-readelf".format(prefix),
"-A", os.path.join("target", fpath)]
out = subprocess.check_output(cmd, cwd=builddir, env={"LANG": "C"})
out = run_cmd_on_host(builddir, cmd)
regexp = re.compile("^ {}: (.*)$".format(tag))
for line in out.splitlines():
m = regexp.match(line)
@@ -87,7 +104,7 @@ def get_elf_prog_interpreter(builddir, prefix, fpath):
"""
cmd = ["host/bin/{}-readelf".format(prefix),
"-l", os.path.join("target", fpath)]
out = subprocess.check_output(cmd, cwd=builddir, env={"LANG": "C"})
out = run_cmd_on_host(builddir, cmd)
regexp = re.compile("^ *\[Requesting program interpreter: (.*)\]$")
for line in out.splitlines():
m = regexp.match(line)

View File

@@ -84,3 +84,9 @@ class BRTest(BRConfigTest):
if self.emulator:
self.emulator.stop()
super(BRTest, self).tearDown()
# Run the given 'cmd' with a 'timeout' on the target and
# assert that the command succeeded
def assertRunOk(self, cmd, timeout=-1):
_, exit_code = self.emulator.run(cmd, timeout)
self.assertEqual(exit_code, 0)

View File

@@ -43,7 +43,7 @@ class Builder(object):
cmd += ["olddefconfig"]
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
env=env)
cwd=infra.basepath(), env=env)
if ret != 0:
raise SystemError("Cannot olddefconfig")

View File

@@ -76,6 +76,7 @@ class Emulator(object):
self.logfile.write("> starting qemu with '%s'\n" % " ".join(qemu_cmd))
self.qemu = pexpect.spawn(qemu_cmd[0], qemu_cmd[1:],
timeout=5 * self.timeout_multiplier,
encoding='utf-8',
env={"QEMU_AUDIO_DRV": "none"})
# We want only stdout into the log to avoid double echo
self.qemu.logfile_read = self.logfile