2021-09-21 23:04:37 +02:00
|
|
|
#!/usr/bin/env python3
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
# Copyright (C) 2014 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
|
|
# This script generates a random configuration for testing Buildroot.
|
|
|
|
|
2022-05-03 02:49:43 +02:00
|
|
|
from binascii import hexlify
|
2022-04-14 00:40:04 +02:00
|
|
|
import asyncio
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
import csv
|
|
|
|
import os
|
|
|
|
from random import randint
|
|
|
|
import sys
|
utils/genrandconfig: dump traceback for unhandled exceptions
In case of an unexpected error, we currently only print the exception as
an str(). For example, the recent issue with the glibc version check
only reported:
TypeError: cannot use a string pattern on a bytes-like object
That does not help in fixing the issue; the exception text is also not
usually very user-friendly either anyway.
We change the reporting to print the traceback, which in the glibc
version check mentioned above, the error is reported as:
Traceback (most recent call last):
File "./utils/genrandconfig", line 740, in <module>
ret = gen_config(args)
File "./utils/genrandconfig", line 676, in gen_config
if not is_toolchain_usable(configfile, toolchainconfig):
File "./utils/genrandconfig", line 186, in is_toolchain_usable
if StrictVersion('2.14') > StrictVersion(glibc_version):
File "/usr/lib/python3.8/distutils/version.py", line 40, in __init__
self.parse(vstring)
File "/usr/lib/python3.8/distutils/version.py", line 135, in parse
match = self.version_re.match(vstring)
TypeError: cannot use a string pattern on a bytes-like object
With this, the error is much easier to pinpoint (it's the last one that
is not in a system module).
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-21 10:41:28 +02:00
|
|
|
import traceback
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
from distutils.version import StrictVersion
|
|
|
|
import platform
|
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
if sys.version_info < (3, 8):
|
|
|
|
from asyncio import coroutine
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
else:
|
2022-04-14 00:40:04 +02:00
|
|
|
from types import coroutine
|
2017-07-21 03:05:10 +02:00
|
|
|
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
class SystemInfo:
|
|
|
|
DEFAULT_NEEDED_PROGS = ["make", "git", "gcc", "timeout"]
|
2019-08-04 11:13:19 +02:00
|
|
|
DEFAULT_OPTIONAL_PROGS = ["bzr", "java", "javac", "jar", "diffoscope"]
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
self.needed_progs = list(self.__class__.DEFAULT_NEEDED_PROGS)
|
|
|
|
self.optional_progs = list(self.__class__.DEFAULT_OPTIONAL_PROGS)
|
|
|
|
self.progs = {}
|
|
|
|
|
|
|
|
def find_prog(self, name, flags=os.X_OK, env=os.environ):
|
2017-07-21 03:05:10 +02:00
|
|
|
if not name or name[0] == os.sep:
|
|
|
|
raise ValueError(name)
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
prog_path = env.get("PATH", None)
|
|
|
|
# for windows compatibility, we'd need to take PATHEXT into account
|
|
|
|
|
|
|
|
if prog_path:
|
|
|
|
for prog_dir in filter(None, prog_path.split(os.pathsep)):
|
|
|
|
# os.join() not necessary: non-empty prog_dir
|
|
|
|
# and name[0] != os.sep
|
|
|
|
prog = prog_dir + os.sep + name
|
|
|
|
if os.access(prog, flags):
|
|
|
|
return prog
|
|
|
|
# --
|
|
|
|
return None
|
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
@coroutine
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
def has(self, prog):
|
|
|
|
"""Checks whether a program is available.
|
|
|
|
Lazily evaluates missing entries.
|
|
|
|
|
2017-07-21 03:05:10 +02:00
|
|
|
Returns: None if prog not found, else path to the program [evaluates
|
|
|
|
to True]
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
"""
|
|
|
|
try:
|
|
|
|
return self.progs[prog]
|
|
|
|
except KeyError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
have_it = self.find_prog(prog)
|
|
|
|
# java[c] needs special care
|
|
|
|
if have_it and prog in ('java', 'javac'):
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_shell(
|
|
|
|
"%s -version | grep gcj" % prog,
|
|
|
|
stdout=asyncio.subprocess.DEVNULL,
|
|
|
|
stderr=asyncio.subprocess.DEVNULL)
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
if ret != 1:
|
|
|
|
have_it = False
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
# --
|
|
|
|
self.progs[prog] = have_it
|
|
|
|
return have_it
|
|
|
|
|
|
|
|
def check_requirements(self):
|
|
|
|
"""Checks program dependencies.
|
|
|
|
|
|
|
|
Returns: True if all mandatory programs are present, else False.
|
|
|
|
"""
|
|
|
|
do_check_has_prog = self.has
|
|
|
|
|
|
|
|
missing_requirements = False
|
|
|
|
for prog in self.needed_progs:
|
|
|
|
if not do_check_has_prog(prog):
|
|
|
|
print("ERROR: your system lacks the '%s' program" % prog)
|
|
|
|
missing_requirements = True
|
|
|
|
|
|
|
|
# check optional programs here,
|
|
|
|
# else they'd get checked by each worker instance
|
|
|
|
for prog in self.optional_progs:
|
|
|
|
do_check_has_prog(prog)
|
|
|
|
|
|
|
|
return not missing_requirements
|
|
|
|
|
2017-07-21 03:05:10 +02:00
|
|
|
|
genrandconfig: get configs from in-tree toolchain-configs.csv
Now we have the toolchain config fragments in the buildroot directory
itself, it is no longer necessary to fetch it from the toolchain URL.
The --toolchains-url option is renamed to --toolchains-csv.
The paths in the toolchains_csv file should be either absolute, or
relative to buildrootdir.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-csv", kwargs['toolchains_csv']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:26 +02:00
|
|
|
def get_toolchain_configs(toolchains_csv, buildrootdir):
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
"""Fetch and return the possible toolchain configurations
|
|
|
|
|
|
|
|
This function returns an array of toolchain configurations. Each
|
|
|
|
toolchain configuration is itself an array of lines of the defconfig.
|
|
|
|
"""
|
|
|
|
|
genrandconfig: get configs from in-tree toolchain-configs.csv
Now we have the toolchain config fragments in the buildroot directory
itself, it is no longer necessary to fetch it from the toolchain URL.
The --toolchains-url option is renamed to --toolchains-csv.
The paths in the toolchains_csv file should be either absolute, or
relative to buildrootdir.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-csv", kwargs['toolchains_csv']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:26 +02:00
|
|
|
with open(toolchains_csv) as r:
|
2017-10-29 18:14:36 +01:00
|
|
|
# filter empty lines and comments
|
2018-03-13 04:09:39 +01:00
|
|
|
lines = [t for t in r.readlines() if len(t.strip()) > 0 and t[0] != '#']
|
2019-12-03 17:51:37 +01:00
|
|
|
toolchains = lines
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configs = []
|
|
|
|
|
|
|
|
(_, _, _, _, hostarch) = os.uname()
|
|
|
|
# ~2015 distros report x86 when on a 32bit install
|
|
|
|
if hostarch == 'i686' or hostarch == 'i386' or hostarch == 'x86':
|
|
|
|
hostarch = 'x86'
|
|
|
|
|
genrandconfig: get configs from in-tree toolchain-configs.csv
Now we have the toolchain config fragments in the buildroot directory
itself, it is no longer necessary to fetch it from the toolchain URL.
The --toolchains-url option is renamed to --toolchains-csv.
The paths in the toolchains_csv file should be either absolute, or
relative to buildrootdir.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-csv", kwargs['toolchains_csv']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:26 +02:00
|
|
|
for row in csv.reader(toolchains):
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
config = {}
|
genrandconfig: get configs from in-tree toolchain-configs.csv
Now we have the toolchain config fragments in the buildroot directory
itself, it is no longer necessary to fetch it from the toolchain URL.
The --toolchains-url option is renamed to --toolchains-csv.
The paths in the toolchains_csv file should be either absolute, or
relative to buildrootdir.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-csv", kwargs['toolchains_csv']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:26 +02:00
|
|
|
configfile = row[0]
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
config_hostarch = row[1]
|
|
|
|
keep = False
|
|
|
|
|
|
|
|
# Keep all toolchain configs that work regardless of the host
|
|
|
|
# architecture
|
|
|
|
if config_hostarch == "any":
|
|
|
|
keep = True
|
|
|
|
|
|
|
|
# Keep all toolchain configs that can work on the current host
|
|
|
|
# architecture
|
|
|
|
if hostarch == config_hostarch:
|
|
|
|
keep = True
|
|
|
|
|
|
|
|
# Assume that x86 32 bits toolchains work on x86_64 build
|
|
|
|
# machines
|
|
|
|
if hostarch == 'x86_64' and config_hostarch == "x86":
|
|
|
|
keep = True
|
|
|
|
|
|
|
|
if not keep:
|
|
|
|
continue
|
|
|
|
|
genrandconfig: get configs from in-tree toolchain-configs.csv
Now we have the toolchain config fragments in the buildroot directory
itself, it is no longer necessary to fetch it from the toolchain URL.
The --toolchains-url option is renamed to --toolchains-csv.
The paths in the toolchains_csv file should be either absolute, or
relative to buildrootdir.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-csv", kwargs['toolchains_csv']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:26 +02:00
|
|
|
if not os.path.isabs(configfile):
|
|
|
|
configfile = os.path.join(buildrootdir, configfile)
|
|
|
|
|
|
|
|
with open(configfile) as r:
|
|
|
|
config = r.readlines()
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configs.append(config)
|
|
|
|
return configs
|
|
|
|
|
2017-07-21 03:05:10 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
@coroutine
|
2017-07-21 03:05:17 +02:00
|
|
|
def is_toolchain_usable(configfile, config):
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
"""Check if the toolchain is actually usable."""
|
|
|
|
|
2017-07-21 03:05:17 +02:00
|
|
|
with open(configfile) as configf:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configlines = configf.readlines()
|
|
|
|
|
|
|
|
# Check that the toolchain configuration is still present
|
2017-07-21 03:05:11 +02:00
|
|
|
for toolchainline in config:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
if toolchainline not in configlines:
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
print("WARN: toolchain can't be used", file=sys.stderr)
|
|
|
|
print(" Missing: %s" % toolchainline.strip(), file=sys.stderr)
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
|
|
|
|
# The latest Linaro toolchains on x86-64 hosts requires glibc
|
|
|
|
# 2.14+ on the host.
|
|
|
|
if platform.machine() == 'x86_64':
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y\n' in configlines or \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64=y\n' in configlines or \
|
2018-06-28 09:24:23 +02:00
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_BE=y\n' in configlines or \
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB=y\n' in configlines:
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(
|
|
|
|
'ldd', '--version', stdout=asyncio.subprocess.PIPE)
|
|
|
|
ldd_version_output, _ = yield from proc.communicate()
|
|
|
|
if proc.returncode:
|
|
|
|
return False
|
2022-08-21 10:41:27 +02:00
|
|
|
glibc_version = ldd_version_output.decode().splitlines()[0].split()[-1]
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
if StrictVersion('2.14') > StrictVersion(glibc_version):
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
print("WARN: ignoring the Linaro ARM toolchains because too old host glibc", file=sys.stderr)
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
2017-07-21 03:05:10 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
@coroutine
|
2019-08-04 11:13:18 +02:00
|
|
|
def fixup_config(sysinfo, configfile):
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
"""Finalize the configuration and reject any problematic combinations
|
|
|
|
|
|
|
|
This function returns 'True' when the configuration has been
|
|
|
|
accepted, and 'False' when the configuration has not been accepted because
|
|
|
|
it is known to fail (in which case another random configuration will be
|
|
|
|
generated).
|
|
|
|
"""
|
|
|
|
|
2017-07-21 03:05:17 +02:00
|
|
|
with open(configfile) as configf:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configlines = configf.readlines()
|
|
|
|
|
2022-04-29 21:15:31 +02:00
|
|
|
ROOTFS_SIZE = '5G'
|
|
|
|
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL = 'BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/'
|
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
has_java = yield from sysinfo.has("java")
|
|
|
|
if "BR2_NEEDS_HOST_JAVA=y\n" in configlines and not has_java:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain is affected by PR58854
|
|
|
|
if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'armv5-ctng-linux-gnueabi.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain tigger an assembler error with guile package when compiled with -Os (same issue as for CS ARM 2014.05-29)
|
2017-07-21 03:05:10 +02:00
|
|
|
if 'BR2_PACKAGE_GUILE=y\n' in configlines and \
|
|
|
|
'BR2_OPTIMIZE_S=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'armv5-ctng-linux-gnueabi.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain is affected by PR58854
|
|
|
|
if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'armv6-ctng-linux-uclibcgnueabi.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain is affected by PR58854
|
|
|
|
if 'BR2_PACKAGE_LTTNG_TOOLS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'armv7-ctng-linux-gnueabihf.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain is affected by PR60155
|
|
|
|
if 'BR2_PACKAGE_SDL=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'powerpc-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The ctng toolchain is affected by PR60155
|
|
|
|
if 'BR2_PACKAGE_LIBMPEG2=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'powerpc-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS toolchain uses eglibc-2.18 which lacks SYS_getdents64
|
|
|
|
if 'BR2_PACKAGE_STRONGSWAN=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS toolchain uses eglibc-2.18 which lacks SYS_getdents64
|
|
|
|
if 'BR2_PACKAGE_PYTHON3=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
arch: drop support for SH2A
Until commit "arch/Config.in.sh: fixup MMU selection" in this series,
SH2A could either be used with BR2_USE_MMU disabled or BR2_USE_MMU
enabled.
The later made absolutely no sense, since SH2A does not have a MMU:
MMU support was introduced starting from SH3 according to
https://en.wikipedia.org/wiki/SuperH#SH-3
Also, since commit 22d5501e03b019218b718b5de7ca74824a8eaf42 ("arch:
tidy up binary formats config"), which was merged in Buildroot
2015.05, the architecture tuple used when BR2_sh2a=y and BR2_USE_MMU
disabled is sh2a-buildroot-uclinux-uclibc, and this was already
unsupported back in the days of Buildroot 2015.08 and binutils 2.24,
causing the build to fail with:
*** BFD does not support target sh2a-buildroot-uclinux-uclibc.
just like it fails to build today with recent version of binutils.
So, this has been broken since 2015.08, and nobody complained. SH2A is
seldom used, so it's time to kill it.
It is worth mentioning that there had been an attempt at resurrecting
SH2 support around 2015 (see https://lwn.net/Articles/647636/) as part
of the J2 core. This effort led to the addition of FDPIC support for
SH2A in the musl C library (and therefore proper ELF binaries, with
shared libraries), but that was never supported in Buildroot. Now that
the J2 project is essentially dead, there is no reason to bother with
this.
Fixes:
http://autobuild.buildroot.net/results/63d01d33ae30f86b63b9f42a9fea116f2f3e9005/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-04-19 23:34:48 +02:00
|
|
|
# libffi not available on ARMv7-M, but propagating libffi arch
|
|
|
|
# dependencies in Buildroot is really too much work, so we handle
|
|
|
|
# this here.
|
2017-07-21 03:05:10 +02:00
|
|
|
if 'BR2_ARM_CPU_ARMV7M=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_LIBFFI=y\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
utils/genrandconfig: disable libopenssl without atomics
libopenssl needs atomic or the build will fail (e.g. on sparcv8 without
libatomic):
${LDCMD:-/nvmedata/autobuild/instance-7/output-1/host/bin/sparc-buildroot-linux-uclibc-gcc} -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g2 -g2 -L. \
-o apps/openssl apps/asn1pars.o apps/ca.o apps/ciphers.o apps/cms.o apps/crl.o apps/crl2p7.o apps/dgst.o apps/dhparam.o apps/dsa.o apps/dsaparam.o apps/ec.o apps/ecparam.o apps/enc.o apps/engine.o apps/errstr.o apps/gendsa.o apps/genpkey.o apps/genrsa.o apps/nseq.o apps/ocsp.o apps/openssl.o apps/passwd.o apps/pkcs12.o apps/pkcs7.o apps/pkcs8.o apps/pkey.o apps/pkeyparam.o apps/pkeyutl.o apps/prime.o apps/rand.o apps/rehash.o apps/req.o apps/rsa.o apps/rsautl.o apps/s_client.o apps/s_server.o apps/s_time.o apps/sess_id.o apps/smime.o apps/speed.o apps/spkac.o apps/srp.o apps/storeutl.o apps/ts.o apps/verify.o apps/version.o apps/x509.o \
apps/libapps.a -lssl -lcrypto -ldl
/nvmedata/autobuild/instance-7/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./libssl.so: undefined reference to `__atomic_fetch_sub_4'
It should be noted that openssl3 has added OPENSSL_DEV_NO_ATOMICS but
"this is intended for internal development only, to check the
refcounting is properly coded. It should never become a configuration
option, hence the name of the macro.":
https://github.com/openssl/openssl/commit/503d4745a115b82db01c1fb22baaddb153d27cdb
Atomics are not available in Buildroot if:
- architecture is 32 bit and something other than ARM or xtensa, and
- GCC < 4.8 or no threads or FLAT.
The nothreads case can theoretically happen in many different
situations, but in practice nobody disables threads. So the only
interesting case is the FLAT case. Since ARM and RISC-V 64 both have
atomics intrinsics, that leaves just m68k NOMMU as FLAT. So this is
truly a corner case.
The proper solution would be to patch GCC to also provide libatomic in
those cases.
- For nothreads, atomics are in fact not needed, so libatomic can simply
be implemented as stubs.
- For FLAT, it's probably just a matter of having a match to uclinux in
libatomic/configure.tgt.
Again, though, this happens only in such niche cases that it's not worth
working on it.
Fixes:
- http://autobuild.buildroot.org/results/bce526d538f43a541fdfbc0c9b4a7cecebbbc539
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2022-08-09 18:27:14 +02:00
|
|
|
# libopenssl needs atomic, but propagating this dependency in
|
|
|
|
# Buildroot is really too much work, so we handle this here.
|
|
|
|
if 'BR2_PACKAGE_LIBOPENSSL=y\n' in configlines and \
|
2022-09-18 17:09:30 +02:00
|
|
|
'BR2_TOOLCHAIN_HAS_ATOMIC=y\n' not in configlines:
|
utils/genrandconfig: disable libopenssl without atomics
libopenssl needs atomic or the build will fail (e.g. on sparcv8 without
libatomic):
${LDCMD:-/nvmedata/autobuild/instance-7/output-1/host/bin/sparc-buildroot-linux-uclibc-gcc} -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g2 -g2 -L. \
-o apps/openssl apps/asn1pars.o apps/ca.o apps/ciphers.o apps/cms.o apps/crl.o apps/crl2p7.o apps/dgst.o apps/dhparam.o apps/dsa.o apps/dsaparam.o apps/ec.o apps/ecparam.o apps/enc.o apps/engine.o apps/errstr.o apps/gendsa.o apps/genpkey.o apps/genrsa.o apps/nseq.o apps/ocsp.o apps/openssl.o apps/passwd.o apps/pkcs12.o apps/pkcs7.o apps/pkcs8.o apps/pkey.o apps/pkeyparam.o apps/pkeyutl.o apps/prime.o apps/rand.o apps/rehash.o apps/req.o apps/rsa.o apps/rsautl.o apps/s_client.o apps/s_server.o apps/s_time.o apps/sess_id.o apps/smime.o apps/speed.o apps/spkac.o apps/srp.o apps/storeutl.o apps/ts.o apps/verify.o apps/version.o apps/x509.o \
apps/libapps.a -lssl -lcrypto -ldl
/nvmedata/autobuild/instance-7/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./libssl.so: undefined reference to `__atomic_fetch_sub_4'
It should be noted that openssl3 has added OPENSSL_DEV_NO_ATOMICS but
"this is intended for internal development only, to check the
refcounting is properly coded. It should never become a configuration
option, hence the name of the macro.":
https://github.com/openssl/openssl/commit/503d4745a115b82db01c1fb22baaddb153d27cdb
Atomics are not available in Buildroot if:
- architecture is 32 bit and something other than ARM or xtensa, and
- GCC < 4.8 or no threads or FLAT.
The nothreads case can theoretically happen in many different
situations, but in practice nobody disables threads. So the only
interesting case is the FLAT case. Since ARM and RISC-V 64 both have
atomics intrinsics, that leaves just m68k NOMMU as FLAT. So this is
truly a corner case.
The proper solution would be to patch GCC to also provide libatomic in
those cases.
- For nothreads, atomics are in fact not needed, so libatomic can simply
be implemented as stubs.
- For FLAT, it's probably just a matter of having a match to uclinux in
libatomic/configure.tgt.
Again, though, this happens only in such niche cases that it's not worth
working on it.
Fixes:
- http://autobuild.buildroot.org/results/bce526d538f43a541fdfbc0c9b4a7cecebbbc539
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
2022-08-09 18:27:14 +02:00
|
|
|
return False
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
if 'BR2_PACKAGE_SUNXI_BOARDS=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE=""\n')
|
|
|
|
configlines.append('BR2_PACKAGE_SUNXI_BOARDS_FEX_FILE="a10/hackberry.fex"\n')
|
|
|
|
# This MIPS uClibc toolchain fails to build the gdb package
|
|
|
|
if 'BR2_PACKAGE_GDB=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS uClibc toolchain fails to build the rt-tests package
|
|
|
|
if 'BR2_PACKAGE_RT_TESTS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS uClibc toolchain fails to build the civetweb package
|
|
|
|
if 'BR2_PACKAGE_CIVETWEB=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS ctng toolchain fails to build the python3 package
|
|
|
|
if 'BR2_PACKAGE_PYTHON3=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mips64el-ctng_n64-linux-gnu.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS uClibc toolchain fails to build the strace package
|
|
|
|
if 'BR2_PACKAGE_STRACE=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS uClibc toolchain fails to build the cdrkit package
|
|
|
|
if 'BR2_PACKAGE_CDRKIT=y\n' in configlines and \
|
|
|
|
'BR2_STATIC_LIBS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# uClibc vfork static linking issue
|
|
|
|
if 'BR2_PACKAGE_ALSA_LIB=y\n' in configlines and \
|
|
|
|
'BR2_STATIC_LIBS=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'i486-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# This MIPS uClibc toolchain fails to build the weston package
|
|
|
|
if 'BR2_PACKAGE_WESTON=y\n' in configlines and \
|
2018-03-13 04:09:39 +01:00
|
|
|
BR2_TOOLCHAIN_EXTERNAL_URL + 'mipsel-ctng-linux-uclibc.tar.xz"\n' in configlines:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
return False
|
|
|
|
# The cs nios2 2017.02 toolchain is affected by binutils PR19405
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_BOOST=y\n' in configlines:
|
|
|
|
return False
|
|
|
|
# The cs nios2 2017.02 toolchain is affected by binutils PR19405
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_QT5BASE_GUI=y\n' in configlines:
|
|
|
|
return False
|
|
|
|
# The cs nios2 2017.02 toolchain is affected by binutils PR19405
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_FLANN=y\n' in configlines:
|
|
|
|
return False
|
toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE
In the internal toolchain backend, we have a choice..endchoice block
to allow the user to select the C library, between glibc, uClibc and
musl.
However, there are situations were no C library at all is
supported. In this case, the choice does not appear, and does not
allow to see the Config.in comments that are within the
choice..endchoice block and that may explain why no C library is
available.
For example, on RISC-V 32-bit, the only C library supported is glibc,
and the minimum kernel header version required by glibc on this
architecture is 5.4.0. In a future commit, we are going to add this
dependency on glibc (to fix build issues on configurations that have
headers < 5.4.0). But since glibc is the only supported C library on
RISC-V 32-bit, it means that the choice..endchoice for the C library
contains no entry, preventing from seeing the Config.in comment.
To address this issue, this commit adds a "dummy"
BR2_TOOLCHAIN_BUILDROOT_NONE option that shows up in the
choice..endchoice only when no C library is available. Thanks to this,
the choice..endchoice is never empty, and the Config.in comments can
be seen.
If the user keeps BR2_TOOLCHAIN_BUILDROOT_NONE selected, then the
build will anyway abort early because package/Makefile.in has a check
to verify that a C library is selected, and aborts the build if not.
Some could say that the problem should be resolved by instead
preventing the selection of headers < 5.4.0 on RISC-V 32-bit, but that
is difficult to do as the user can choose a custom header version, or
simply specific that (s)he wants to use the headers of the kernel
being built. In those situations, it's difficult to prevent selecting
headers < 5.4.0.
Prevent random configurations from triggering a build failure in our
autobuilders, by excluding that symbol from accepted configuration.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[yann.morin.1998@free.fr: update genrandconfig]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-10-26 20:34:26 +02:00
|
|
|
# No C library for internal toolchain
|
|
|
|
if 'BR2_TOOLCHAIN_BUILDROOT_NONE=y' in configlines:
|
|
|
|
return False
|
2022-11-11 22:57:59 +01:00
|
|
|
# Xtensa custom cores require an overlay file with internal
|
|
|
|
# toolchains
|
|
|
|
if 'BR2_XTENSA_CUSTOM=y' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_BUILDROOT=y' in configlines:
|
|
|
|
return False
|
toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE
In the internal toolchain backend, we have a choice..endchoice block
to allow the user to select the C library, between glibc, uClibc and
musl.
However, there are situations were no C library at all is
supported. In this case, the choice does not appear, and does not
allow to see the Config.in comments that are within the
choice..endchoice block and that may explain why no C library is
available.
For example, on RISC-V 32-bit, the only C library supported is glibc,
and the minimum kernel header version required by glibc on this
architecture is 5.4.0. In a future commit, we are going to add this
dependency on glibc (to fix build issues on configurations that have
headers < 5.4.0). But since glibc is the only supported C library on
RISC-V 32-bit, it means that the choice..endchoice for the C library
contains no entry, preventing from seeing the Config.in comment.
To address this issue, this commit adds a "dummy"
BR2_TOOLCHAIN_BUILDROOT_NONE option that shows up in the
choice..endchoice only when no C library is available. Thanks to this,
the choice..endchoice is never empty, and the Config.in comments can
be seen.
If the user keeps BR2_TOOLCHAIN_BUILDROOT_NONE selected, then the
build will anyway abort early because package/Makefile.in has a check
to verify that a C library is selected, and aborts the build if not.
Some could say that the problem should be resolved by instead
preventing the selection of headers < 5.4.0 on RISC-V 32-bit, but that
is difficult to do as the user can choose a custom header version, or
simply specific that (s)he wants to use the headers of the kernel
being built. In those situations, it's difficult to prevent selecting
headers < 5.4.0.
Prevent random configurations from triggering a build failure in our
autobuilders, by excluding that symbol from accepted configuration.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[yann.morin.1998@free.fr: update genrandconfig]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2022-10-26 20:34:26 +02:00
|
|
|
|
2022-08-23 23:23:46 +02:00
|
|
|
if 'BR2_PACKAGE_AUFS_UTIL=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_AUFS_UTIL_VERSION=""\n' in configlines:
|
|
|
|
return False
|
2022-09-18 18:28:50 +02:00
|
|
|
if 'BR2_PACKAGE_A10DISP=y\n' in configlines:
|
|
|
|
return False
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2022-05-03 03:50:39 +02:00
|
|
|
if 'BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE=""\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE=""\n' in configlines:
|
2020-09-24 21:29:12 +02:00
|
|
|
bootenv = os.path.join(args.outputdir, "boot_env.txt")
|
|
|
|
with open(bootenv, "w+") as bootenvf:
|
|
|
|
bootenvf.write("prop=value")
|
|
|
|
configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE=""\n')
|
|
|
|
configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SOURCE="%s"\n' % bootenv)
|
|
|
|
configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE=""\n')
|
|
|
|
configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_ENVIMAGE_SIZE="0x1000"\n')
|
|
|
|
|
2022-05-03 03:50:39 +02:00
|
|
|
if 'BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n' in configlines:
|
2020-09-24 21:29:12 +02:00
|
|
|
bootscr = os.path.join(args.outputdir, "boot_script.txt")
|
|
|
|
with open(bootscr, "w+") as bootscrf:
|
|
|
|
bootscrf.write("prop=value")
|
|
|
|
configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n')
|
|
|
|
configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="%s"\n' % bootscr)
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_ROOTFS_SKELETON_CUSTOM=y\n' in configlines and \
|
|
|
|
'BR2_ROOTFS_SKELETON_CUSTOM_PATH=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_ROOTFS_SKELETON_CUSTOM=y\n')
|
|
|
|
configlines.remove('BR2_ROOTFS_SKELETON_CUSTOM_PATH=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_USE_DEFCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_DEFCONFIG=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_USE_DEFCONFIG=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_DEFCONFIG=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_HG=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_HG=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_SVN=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_SVN=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_VERSION=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_VERSION=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_DTS_SUPPORT=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_INTREE_DTS_NAME=""\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_CUSTOM_DTS_PATH=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_DTS_SUPPORT=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_INTREE_DTS_NAME=""\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUSTOM_DTS_PATH=""\n')
|
|
|
|
if 'BR2_LINUX_KERNEL_APPENDED_UIMAGE=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_APPENDED_UIMAGE=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_UIMAGE=y\n')
|
|
|
|
if 'BR2_LINUX_KERNEL_APPENDED_ZIMAGE=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_APPENDED_ZIMAGE=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_ZIMAGE=y\n')
|
2022-05-03 04:31:17 +02:00
|
|
|
if 'BR2_LINUX_KERNEL_CUIMAGE=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_CUIMAGE=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_UIMAGE=y\n')
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_LINUX_KERNEL_SIMPLEIMAGE=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_SIMPLEIMAGE=y\n')
|
|
|
|
configlines.append('BR2_LINUX_KERNEL_VMLINUX=y\n')
|
|
|
|
|
|
|
|
if 'BR2_LINUX_KERNEL_EXT_AUFS=y\n' in configlines and \
|
|
|
|
'BR2_LINUX_KERNEL_EXT_AUFS_VERSION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_EXT_AUFS=y\n')
|
|
|
|
configlines.remove('BR2_LINUX_KERNEL_EXT_AUFS_VERSION=""\n')
|
|
|
|
|
|
|
|
if 'BR2_PACKAGE_LINUX_BACKPORTS=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_PACKAGE_LINUX_BACKPORTS=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG=""\n')
|
|
|
|
|
|
|
|
if 'BR2_KERNEL_HEADERS_VERSION=y\n' in configlines and \
|
|
|
|
'BR2_DEFAULT_KERNEL_VERSION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_KERNEL_HEADERS_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_DEFAULT_KERNEL_VERSION=""\n')
|
|
|
|
|
|
|
|
if 'BR2_KERNEL_HEADERS_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_KERNEL_HEADERS_CUSTOM_REPO_URL=""\n':
|
|
|
|
configlines.remove('BR2_KERNEL_HEADERS_CUSTOM_GIT=y\n')
|
|
|
|
configlines.remove('BR2_KERNEL_HEADERS_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_KERNEL_HEADERS_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_KERNEL_HEADERS_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.remove('BR2_KERNEL_HEADERS_CUSTOM_TARBALL_LOCATION=""\n')
|
|
|
|
|
2022-08-10 09:45:47 +02:00
|
|
|
if 'BR2_TARGET_ARM_TRUSTED_FIRMWARE=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM=""\n' in configlines:
|
2022-08-24 13:20:33 +02:00
|
|
|
return False
|
2022-08-10 09:45:47 +02:00
|
|
|
|
2022-05-18 00:58:21 +02:00
|
|
|
if 'BR2_TARGET_ARM_TRUSTED_FIRMWARE=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y\n')
|
|
|
|
configlines.append('BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_ARM_TRUSTED_FIRMWARE=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_ARM_TRUSTED_FIRMWARE=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_TARGET_AT91BOOTSTRAP3=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_AT91BOOTSTRAP3=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_BAREBOX=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_BAREBOX=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_BAREBOX_USE_DEFCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_BAREBOX_BOARD_DEFCONFIG=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX_USE_DEFCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_BAREBOX_BOARD_DEFCONFIG=""\n')
|
|
|
|
|
2023-02-25 23:50:31 +01:00
|
|
|
if 'BR2_TARGET_BOOT_WRAPPER_AARCH64=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS=""\n' in configlines:
|
|
|
|
return False
|
|
|
|
|
2022-06-29 09:55:59 +02:00
|
|
|
if 'BR2_TARGET_OPTEE_OS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_TARGET_OPTEE_OS_LATEST=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION=""\n')
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_TARGET_OPTEE_OS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPTEE_OS_PLATFORM=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_OPTEE_OS=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_OPTEE_OS_PLATFORM=""\n')
|
|
|
|
|
2023-07-09 16:51:18 +02:00
|
|
|
if 'BR2_TARGET_ROOTFS_CRAMFS=y\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_CRAMFS=y\n')
|
|
|
|
|
2022-05-01 09:38:44 +02:00
|
|
|
if 'BR2_TARGET_ROOTFS_EXT2=y\n' in configlines and \
|
2022-04-29 21:15:31 +02:00
|
|
|
'BR2_TARGET_ROOTFS_EXT2_SIZE="60M"\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_EXT2_SIZE="60M"\n')
|
|
|
|
configlines.append('BR2_TARGET_ROOTFS_EXT2_SIZE="%s"\n' % ROOTFS_SIZE)
|
|
|
|
|
|
|
|
if 'BR2_TARGET_ROOTFS_F2FS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ROOTFS_F2FS_SIZE="100M"\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_F2FS_SIZE="100M"\n')
|
|
|
|
configlines.append('BR2_TARGET_ROOTFS_F2FS_SIZE="%s"\n' % ROOTFS_SIZE)
|
|
|
|
|
2023-07-14 20:24:00 +02:00
|
|
|
if 'BR2_TARGET_ROOTFS_UBIFS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT=2048\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT=2048\n')
|
|
|
|
configlines.append('BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT=41610\n')
|
|
|
|
|
2023-02-21 15:45:05 +01:00
|
|
|
if 'BR2_TARGET_ROOTFS_UBI=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_ROOTFS_UBI_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_TARGET_S500_BOOTLOADER=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_S500_BOOTLOADER_BOARD=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_S500_BOOTLOADER=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_S500_BOOTLOADER_BOARD=""\n')
|
|
|
|
|
2023-02-25 10:22:27 +01:00
|
|
|
if 'BR2_TARGET_TI_K3_R5_LOADER=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG=""\n' in configlines:
|
|
|
|
return False
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_TARGET_UBOOT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_UBOOT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_USE_DEFCONFIG=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_BOARD_DEFCONFIG=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_USE_DEFCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_BOARD_DEFCONFIG=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_UBOOT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_UBOOT_BOARDNAME=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_UBOOT_BOARDNAME=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL=y\n' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y\n' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_PATH=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL=y\n')
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y\n')
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL_PATH=""\n')
|
|
|
|
if 'BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT=y\n' in configlines:
|
|
|
|
return False
|
|
|
|
|
|
|
|
if 'BR2_TOOLCHAIN_EXTERNAL=y\n' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y\n' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y\n' in configlines and \
|
|
|
|
'BR2_TOOLCHAIN_EXTERNAL_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL=y\n')
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y\n')
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y\n')
|
|
|
|
configlines.remove('BR2_TOOLCHAIN_EXTERNAL_URL=""\n')
|
|
|
|
if 'BR2_ARCH_HAS_NO_TOOLCHAIN_BUILDROOT=y\n' in configlines:
|
|
|
|
return False
|
|
|
|
|
2022-12-04 23:11:45 +01:00
|
|
|
if 'BR2_TARGET_MXS_BOOTLETS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD=y\n')
|
|
|
|
configlines.append('BR2_TARGET_MXS_BOOTLETS_STMP37xx=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME=""\n')
|
|
|
|
|
2022-08-25 00:14:24 +02:00
|
|
|
if 'BR2_TARGET_MXS_BOOTLETS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_TARGET_MXS_BOOTLETS_FREESCALE=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_MXS_BOOTLETS=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_TARGET_MXS_BOOTLETS_FREESCALE=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL=""\n')
|
|
|
|
|
2022-08-15 19:01:29 +02:00
|
|
|
if 'BR2_TARGET_OPENSBI=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_TARGET_OPENSBI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_OPENSBI=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_TARGET_OPENSBI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION=""\n')
|
|
|
|
|
|
|
|
if 'BR2_TARGET_OPENSBI=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_VERSION=y\n' in configlines and \
|
|
|
|
'BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_VERSION=y\n')
|
|
|
|
configlines.append('BR2_TARGET_OPENSBI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE=""\n')
|
|
|
|
|
2022-08-08 23:26:07 +02:00
|
|
|
if 'BR2_PACKAGE_REFPOLICY=y\n' in configlines and \
|
2022-08-08 13:04:14 +02:00
|
|
|
'BR2_PACKAGE_REFPOLICY_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_REFPOLICY_CUSTOM_REPO_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_REFPOLICY_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_REFPOLICY_CUSTOM_REPO_URL=""\n')
|
|
|
|
|
2022-08-09 16:31:26 +02:00
|
|
|
if 'BR2_PACKAGE_XENOMAI=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_CUSTOM_GIT=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_REPOSITORY=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_CUSTOM_GIT=y\n')
|
|
|
|
configlines.append('BR2_PACKAGE_XENOMAI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_REPOSITORY=""\n')
|
|
|
|
|
|
|
|
if 'BR2_PACKAGE_XENOMAI=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL=y\n')
|
|
|
|
configlines.append('BR2_PACKAGE_XENOMAI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_CUSTOM_TARBALL_URL=""\n')
|
|
|
|
|
|
|
|
if 'BR2_PACKAGE_XENOMAI=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_CUSTOM_VERSION=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XENOMAI_CUSTOM_VERSION_VALUE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_CUSTOM_VERSION=y\n')
|
|
|
|
configlines.append('BR2_PACKAGE_XENOMAI_LATEST_VERSION=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_XENOMAI_CUSTOM_VERSION_VALUE=""\n')
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if 'BR2_PACKAGE_XVISOR=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG=y\n' in configlines and \
|
|
|
|
'BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE=""\n' in configlines:
|
|
|
|
configlines.remove('BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG=y\n')
|
|
|
|
configlines.append('BR2_PACKAGE_XVISOR_USE_DEFCONFIG=y\n')
|
|
|
|
configlines.remove('BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE=""\n')
|
|
|
|
|
2022-11-16 22:21:05 +01:00
|
|
|
# Don't build igh-ethercat driver as they are highly
|
|
|
|
# kernel-version specific
|
|
|
|
for opt in ['8139TOO', 'E100', 'E1000', 'E1000E', 'R8169']:
|
|
|
|
optstr = 'BR2_PACKAGE_IGH_ETHERCAT_%s=y\n' % opt
|
|
|
|
if optstr in configlines:
|
|
|
|
configlines.remove(optstr)
|
|
|
|
|
2017-07-21 03:05:17 +02:00
|
|
|
with open(configfile, "w+") as configf:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configf.writelines(configlines)
|
|
|
|
|
|
|
|
return True
|
|
|
|
|
2017-07-21 03:05:10 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
@coroutine
|
2017-07-21 03:05:11 +02:00
|
|
|
def gen_config(args):
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
"""Generate a new random configuration
|
|
|
|
|
|
|
|
This function generates the configuration, by choosing a random
|
|
|
|
toolchain configuration and then generating a random selection of
|
|
|
|
packages.
|
|
|
|
"""
|
|
|
|
|
2019-08-04 11:13:18 +02:00
|
|
|
sysinfo = SystemInfo()
|
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
if args.toolchains_csv:
|
|
|
|
# Select a random toolchain configuration
|
|
|
|
configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2022-04-05 13:50:40 +02:00
|
|
|
i = randint(0, len(configs) - 1)
|
|
|
|
toolchainconfig = configs[i]
|
|
|
|
else:
|
|
|
|
toolchainconfig = []
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
genrandconfig: use minimal.config
This has a number of side-effects which must be handled.
The lines in minimal.config may be overridden by the random lines added
by amending the configuration, so is_toolchain_usable() shouldn't take
those into account, or indeed the random lines added. Therefore, make
a copy of the config before appending minimal.config and the random
lines. While we're at it, rename the variable to the more appropriate
toolchainconfig.
minimal.config sets BR2_INIT_NONE=y, but we really also want to test
with BR2_INIT_BUSYBOX=y. Therefore, add a random line to use the
busybox init system. We set its probability rather high. The
probabilities of systemd and eudev are increased since they're now
in the else branch of BR2_INIT_BUSYBOX, which halves the probability
that we even get there.
We now also generate configurations without busybox. Previously,
busybox was almost always selected due to BR2_INIT_BUSYBOX=y. Only if
systemd is selected there was a chance to build without busybox.
We now set BR2_SYSTEM_BIN_SH_NONE=y, the other /bin/sh options are
never tested. However, this is not really something that is relevant
to test in the autobuilders.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:22 +02:00
|
|
|
configlines = list(toolchainconfig)
|
|
|
|
|
|
|
|
# Combine with the minimal configuration
|
|
|
|
minimalconfigfile = os.path.join(args.buildrootdir,
|
|
|
|
'support/config-fragments/minimal.config')
|
|
|
|
with open(minimalconfigfile) as minimalf:
|
|
|
|
configlines += minimalf.readlines()
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2017-09-02 23:29:38 +02:00
|
|
|
# Allow hosts with old certificates to download over https
|
2018-11-15 17:34:09 +01:00
|
|
|
configlines.append("BR2_WGET=\"wget --passive-ftp -nd -t 3 --no-check-certificate\"\n")
|
2017-09-02 23:29:38 +02:00
|
|
|
|
2019-12-03 15:59:03 +01:00
|
|
|
# Per-package folder
|
|
|
|
if randint(0, 15) == 0:
|
|
|
|
configlines.append("BR2_PER_PACKAGE_DIRECTORIES=y\n")
|
|
|
|
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
# Amend the configuration with a few things.
|
|
|
|
if randint(0, 20) == 0:
|
|
|
|
configlines.append("BR2_ENABLE_DEBUG=y\n")
|
2021-06-01 16:34:21 +02:00
|
|
|
if randint(0, 20) == 0:
|
|
|
|
configlines.append("BR2_ENABLE_RUNTIME_DEBUG=y\n")
|
genrandconfig: use minimal.config
This has a number of side-effects which must be handled.
The lines in minimal.config may be overridden by the random lines added
by amending the configuration, so is_toolchain_usable() shouldn't take
those into account, or indeed the random lines added. Therefore, make
a copy of the config before appending minimal.config and the random
lines. While we're at it, rename the variable to the more appropriate
toolchainconfig.
minimal.config sets BR2_INIT_NONE=y, but we really also want to test
with BR2_INIT_BUSYBOX=y. Therefore, add a random line to use the
busybox init system. We set its probability rather high. The
probabilities of systemd and eudev are increased since they're now
in the else branch of BR2_INIT_BUSYBOX, which halves the probability
that we even get there.
We now also generate configurations without busybox. Previously,
busybox was almost always selected due to BR2_INIT_BUSYBOX=y. Only if
systemd is selected there was a chance to build without busybox.
We now set BR2_SYSTEM_BIN_SH_NONE=y, the other /bin/sh options are
never tested. However, this is not really something that is relevant
to test in the autobuilders.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:22 +02:00
|
|
|
if randint(0, 1) == 0:
|
|
|
|
configlines.append("BR2_INIT_BUSYBOX=y\n")
|
|
|
|
elif randint(0, 15) == 0:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configlines.append("BR2_INIT_SYSTEMD=y\n")
|
genrandconfig: use minimal.config
This has a number of side-effects which must be handled.
The lines in minimal.config may be overridden by the random lines added
by amending the configuration, so is_toolchain_usable() shouldn't take
those into account, or indeed the random lines added. Therefore, make
a copy of the config before appending minimal.config and the random
lines. While we're at it, rename the variable to the more appropriate
toolchainconfig.
minimal.config sets BR2_INIT_NONE=y, but we really also want to test
with BR2_INIT_BUSYBOX=y. Therefore, add a random line to use the
busybox init system. We set its probability rather high. The
probabilities of systemd and eudev are increased since they're now
in the else branch of BR2_INIT_BUSYBOX, which halves the probability
that we even get there.
We now also generate configurations without busybox. Previously,
busybox was almost always selected due to BR2_INIT_BUSYBOX=y. Only if
systemd is selected there was a chance to build without busybox.
We now set BR2_SYSTEM_BIN_SH_NONE=y, the other /bin/sh options are
never tested. However, this is not really something that is relevant
to test in the autobuilders.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:22 +02:00
|
|
|
elif randint(0, 10) == 0:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configlines.append("BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y\n")
|
|
|
|
if randint(0, 20) == 0:
|
|
|
|
configlines.append("BR2_STATIC_LIBS=y\n")
|
2021-10-15 17:16:36 +02:00
|
|
|
if randint(0, 20) == 0:
|
|
|
|
configlines.append("BR2_PACKAGE_PYTHON3_PY_ONLY=y\n")
|
2018-12-03 22:25:42 +01:00
|
|
|
if randint(0, 5) == 0:
|
|
|
|
configlines.append("BR2_OPTIMIZE_2=y\n")
|
2019-03-31 14:21:06 +02:00
|
|
|
if randint(0, 4) == 0:
|
|
|
|
configlines.append("BR2_SYSTEM_ENABLE_NLS=y\n")
|
2019-10-27 17:13:24 +01:00
|
|
|
if randint(0, 4) == 0:
|
|
|
|
configlines.append("BR2_FORTIFY_SOURCE_2=y\n")
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2019-06-07 10:55:58 +02:00
|
|
|
# Randomly enable BR2_REPRODUCIBLE 10% of times
|
|
|
|
# also enable tar filesystem images for testing
|
2022-04-14 00:40:04 +02:00
|
|
|
has_diffoscope = yield from sysinfo.has("diffoscope")
|
|
|
|
if has_diffoscope and randint(0, 10) == 0:
|
2019-06-07 10:55:58 +02:00
|
|
|
configlines.append("BR2_REPRODUCIBLE=y\n")
|
|
|
|
configlines.append("BR2_TARGET_ROOTFS_TAR=y\n")
|
|
|
|
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
# Write out the configuration file
|
genrandconfig: pass outputdir and buildrootdir as arguments
The --instance argument is just an artifact of genrandconfig's
history as part of autobuild-run. It is much more logical to pass
the output directory and the buildroot directory as arguments, with
sane defaults.
This also allows us to remove the hack of creating a symlink in the
instance directory if it doesn't exist yet.
Note that the default outputdir 'output' doesn't work yet, because in
that case Buildroot will put the config file in the buildroot directory
instead of the output directory. This will be fixed in a follow-up
patch.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-url", kwargs['toolchains_url']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:16 +02:00
|
|
|
if not os.path.exists(args.outputdir):
|
|
|
|
os.makedirs(args.outputdir)
|
2017-07-21 03:05:18 +02:00
|
|
|
if args.outputdir == os.path.abspath(os.path.join(args.buildrootdir, "output")):
|
|
|
|
configfile = os.path.join(args.buildrootdir, ".config")
|
|
|
|
else:
|
|
|
|
configfile = os.path.join(args.outputdir, ".config")
|
2017-07-21 03:05:17 +02:00
|
|
|
with open(configfile, "w+") as configf:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
configf.writelines(configlines)
|
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(
|
|
|
|
"make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "olddefconfig")
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
if ret:
|
|
|
|
return ret
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
toolchain_usable = yield from is_toolchain_usable(configfile, toolchainconfig)
|
|
|
|
if not toolchain_usable:
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
return 2
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
# Now, generate the random selection of packages, and fixup
|
|
|
|
# things if needed.
|
|
|
|
# Safe-guard, in case we can not quickly come to a valid
|
|
|
|
# configuration: allow at most 100 (arbitrary) iterations.
|
|
|
|
bounded_loop = 100
|
|
|
|
while True:
|
|
|
|
if bounded_loop == 0:
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
print("ERROR: cannot generate random configuration after 100 iterations",
|
|
|
|
file=sys.stderr)
|
|
|
|
return 1
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
bounded_loop -= 1
|
2022-05-03 02:49:43 +02:00
|
|
|
make_rand = [
|
|
|
|
"make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
|
|
|
"KCONFIG_SEED=0x%s" % hexlify(os.urandom(4)).decode("ascii").upper(),
|
|
|
|
"KCONFIG_PROBABILITY=%d" % randint(1, 20),
|
|
|
|
"randpackageconfig" if args.toolchains_csv else "randconfig"
|
|
|
|
]
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(*make_rand)
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
if ret:
|
|
|
|
return ret
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
ret = yield from fixup_config(sysinfo, configfile)
|
|
|
|
if ret:
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
break
|
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(
|
|
|
|
"make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "olddefconfig")
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
if ret:
|
|
|
|
return ret
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(
|
|
|
|
"make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "savedefconfig")
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
if ret:
|
|
|
|
return ret
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
2022-04-14 00:40:04 +02:00
|
|
|
proc = yield from asyncio.create_subprocess_exec(
|
|
|
|
"make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "dependencies")
|
|
|
|
ret = yield from proc.wait()
|
|
|
|
return ret
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser(description="Generate a random configuration")
|
genrandconfig: pass outputdir and buildrootdir as arguments
The --instance argument is just an artifact of genrandconfig's
history as part of autobuild-run. It is much more logical to pass
the output directory and the buildroot directory as arguments, with
sane defaults.
This also allows us to remove the hack of creating a symlink in the
instance directory if it doesn't exist yet.
Note that the default outputdir 'output' doesn't work yet, because in
that case Buildroot will put the config file in the buildroot directory
instead of the output directory. This will be fixed in a follow-up
patch.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-url", kwargs['toolchains_url']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:16 +02:00
|
|
|
parser.add_argument("--outputdir", "-o",
|
|
|
|
help="Output directory (relative to current directory)",
|
|
|
|
type=str, default='output')
|
|
|
|
parser.add_argument("--buildrootdir", "-b",
|
|
|
|
help="Buildroot directory (relative to current directory)",
|
|
|
|
type=str, default='.')
|
2022-04-05 13:50:40 +02:00
|
|
|
|
|
|
|
toolchains_csv = parser.add_mutually_exclusive_group(required=False)
|
|
|
|
toolchains_csv.add_argument("--toolchains-csv",
|
|
|
|
dest="toolchains_csv",
|
|
|
|
help="Path of the toolchain configuration file",
|
|
|
|
type=str)
|
|
|
|
toolchains_csv.add_argument("--no-toolchains-csv",
|
|
|
|
dest="toolchains_csv",
|
|
|
|
help="Generate random toolchain configuration",
|
|
|
|
action='store_false')
|
|
|
|
parser.set_defaults(toolchains_csv="support/config-fragments/autobuild/toolchain-configs.csv")
|
|
|
|
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2017-07-21 03:05:14 +02:00
|
|
|
# We need the absolute path to use with O=, because the relative
|
|
|
|
# path to the output directory here is not relative to the
|
genrandconfig: pass outputdir and buildrootdir as arguments
The --instance argument is just an artifact of genrandconfig's
history as part of autobuild-run. It is much more logical to pass
the output directory and the buildroot directory as arguments, with
sane defaults.
This also allows us to remove the hack of creating a symlink in the
instance directory if it doesn't exist yet.
Note that the default outputdir 'output' doesn't work yet, because in
that case Buildroot will put the config file in the buildroot directory
instead of the output directory. This will be fixed in a follow-up
patch.
After this change, the script should be called from autobuild-run as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-o", outputdir, "-b", srcdir,
"--toolchains-url", kwargs['toolchains_url']],
stdout=devnull, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:16 +02:00
|
|
|
# Buildroot sources, but to the current directory.
|
|
|
|
args.outputdir = os.path.abspath(args.outputdir)
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
try:
|
2022-04-14 00:40:04 +02:00
|
|
|
if sys.version_info < (3, 7):
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
ret = loop.run_until_complete(gen_config(args))
|
|
|
|
else:
|
|
|
|
ret = asyncio.run(gen_config(args))
|
utils/genrandconfig: dump traceback for unhandled exceptions
In case of an unexpected error, we currently only print the exception as
an str(). For example, the recent issue with the glibc version check
only reported:
TypeError: cannot use a string pattern on a bytes-like object
That does not help in fixing the issue; the exception text is also not
usually very user-friendly either anyway.
We change the reporting to print the traceback, which in the glibc
version check mentioned above, the error is reported as:
Traceback (most recent call last):
File "./utils/genrandconfig", line 740, in <module>
ret = gen_config(args)
File "./utils/genrandconfig", line 676, in gen_config
if not is_toolchain_usable(configfile, toolchainconfig):
File "./utils/genrandconfig", line 186, in is_toolchain_usable
if StrictVersion('2.14') > StrictVersion(glibc_version):
File "/usr/lib/python3.8/distutils/version.py", line 40, in __init__
self.parse(vstring)
File "/usr/lib/python3.8/distutils/version.py", line 135, in parse
match = self.version_re.match(vstring)
TypeError: cannot use a string pattern on a bytes-like object
With this, the error is much easier to pinpoint (it's the last one that
is not in a system module).
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-08-21 10:41:28 +02:00
|
|
|
except Exception:
|
|
|
|
traceback.print_exc()
|
utils/genrandconfig: new script
This script will be used by the autobuild-run script to generate the
configuration to test. It is put in the utils directory because it can
also be called directly to allow users to test things.
For now, it is a direct copy of the relevant functions from the
autobuild-run script. The only changes are:
- unneeded import statements are removed;
- code/decode wrappers are limited to decode_byte_list;
- __main__ handling is added.
For now, the only supported arguments are the ones needed for
autobuild-run. Follow-up patches will refactor things and also change
the way the script is called. In this version, it can be called from the
autobuild-run script as:
subprocess.call([os.path.join(srcdir, "utils/genrandconfig"),
"-i", str(kwargs['instance']),
"--toolchains-url", kwargs['toolchains_url']],
stdout=log, stderr=log)
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:08 +02:00
|
|
|
parser.exit(1)
|
genrandconfig: verbose output and use stderr
The output of genrandconfig is currently very terse, which is annoying
for debugging the script or generally seeing what is going on. Also the
timing information added by log_write isn't very useful when the script
is used stand-alone.
In the new setup, (verbose) output goes to stdout and error output goes
to stderr. Also the "INFO: generate the configuration" message is
eliminated - it should go in the autobuild-run script.
We also add an explicit message when a toolchain can't be used after
the first defconfig, otherwise autobuild-run will just silently
restart.
Note that, since the output of make is no longer redirected to
/dev/null, we get one more message on stderr that will be recorded in
the autobuilder's log file: KCONFIG_SEED=0xXXXXXXXX.
This approach allows us to optimise the error handling to use
exceptions, where appropriate, which can be caught at the top level and
converted to an error message to stderr. This, in turn, allows us to use
subprocess.check_call, which eliminates a lot of conditions.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-21 03:05:13 +02:00
|
|
|
parser.exit(ret)
|