|
@@ -118,15 +118,15 @@ class SystemInfo:
|
|
return not missing_requirements
|
|
return not missing_requirements
|
|
|
|
|
|
|
|
|
|
-def get_toolchain_configs(toolchains_url):
|
|
|
|
|
|
+def get_toolchain_configs(toolchains_csv, buildrootdir):
|
|
"""Fetch and return the possible toolchain configurations
|
|
"""Fetch and return the possible toolchain configurations
|
|
|
|
|
|
This function returns an array of toolchain configurations. Each
|
|
This function returns an array of toolchain configurations. Each
|
|
toolchain configuration is itself an array of lines of the defconfig.
|
|
toolchain configuration is itself an array of lines of the defconfig.
|
|
"""
|
|
"""
|
|
|
|
|
|
- with urlopen_closing(toolchains_url) as r:
|
|
|
|
- toolchains_csv = decode_byte_list(r.readlines())
|
|
|
|
|
|
+ with open(toolchains_csv) as r:
|
|
|
|
+ toolchains = decode_byte_list(r.readlines())
|
|
configs = []
|
|
configs = []
|
|
|
|
|
|
(_, _, _, _, hostarch) = os.uname()
|
|
(_, _, _, _, hostarch) = os.uname()
|
|
@@ -134,9 +134,9 @@ def get_toolchain_configs(toolchains_url):
|
|
if hostarch == 'i686' or hostarch == 'i386' or hostarch == 'x86':
|
|
if hostarch == 'i686' or hostarch == 'i386' or hostarch == 'x86':
|
|
hostarch = 'x86'
|
|
hostarch = 'x86'
|
|
|
|
|
|
- for row in csv.reader(toolchains_csv):
|
|
|
|
|
|
+ for row in csv.reader(toolchains):
|
|
config = {}
|
|
config = {}
|
|
- url = row[0]
|
|
|
|
|
|
+ configfile = row[0]
|
|
config_hostarch = row[1]
|
|
config_hostarch = row[1]
|
|
keep = False
|
|
keep = False
|
|
|
|
|
|
@@ -158,8 +158,11 @@ def get_toolchain_configs(toolchains_url):
|
|
if not keep:
|
|
if not keep:
|
|
continue
|
|
continue
|
|
|
|
|
|
- with urlopen_closing(url) as r:
|
|
|
|
- config = decode_byte_list(r.readlines())
|
|
|
|
|
|
+ if not os.path.isabs(configfile):
|
|
|
|
+ configfile = os.path.join(buildrootdir, configfile)
|
|
|
|
+
|
|
|
|
+ with open(configfile) as r:
|
|
|
|
+ config = r.readlines()
|
|
configs.append(config)
|
|
configs.append(config)
|
|
return configs
|
|
return configs
|
|
|
|
|
|
@@ -329,7 +332,7 @@ def gen_config(args):
|
|
"""
|
|
"""
|
|
|
|
|
|
# Select a random toolchain configuration
|
|
# Select a random toolchain configuration
|
|
- configs = get_toolchain_configs(args.toolchains_url)
|
|
|
|
|
|
+ configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
|
|
|
|
|
|
i = randint(0, len(configs) - 1)
|
|
i = randint(0, len(configs) - 1)
|
|
toolchainconfig = configs[i]
|
|
toolchainconfig = configs[i]
|
|
@@ -408,10 +411,10 @@ if __name__ == '__main__':
|
|
parser.add_argument("--buildrootdir", "-b",
|
|
parser.add_argument("--buildrootdir", "-b",
|
|
help="Buildroot directory (relative to current directory)",
|
|
help="Buildroot directory (relative to current directory)",
|
|
type=str, default='.')
|
|
type=str, default='.')
|
|
- parser.add_argument("--toolchains-url",
|
|
|
|
- help="URL of toolchain configuration file",
|
|
|
|
|
|
+ parser.add_argument("--toolchains-csv",
|
|
|
|
+ help="Path of the toolchain configuration file",
|
|
type=str,
|
|
type=str,
|
|
- default="http://autobuild.buildroot.org/toolchains/configs/toolchain-configs.csv")
|
|
|
|
|
|
+ default="support/config-fragments/autobuild/toolchain-configs.csv")
|
|
args = parser.parse_args()
|
|
args = parser.parse_args()
|
|
|
|
|
|
# We need the absolute path to use with O=, because the relative
|
|
# We need the absolute path to use with O=, because the relative
|