From: Thomas Petazzoni Date: Sun, 4 Aug 2019 09:13:18 +0000 (+0200) Subject: utils/genrandconfig: instantiate SystemInfo() earlier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4693676ec5e647c13f766c679c3e6800f0d29026;p=buildroot.git utils/genrandconfig: instantiate SystemInfo() earlier In a future patch, we are going to need a SystemInfo() instance in gen_config(), so create the SystemInfo() instance there, and pass it to fixup_config(), where we currently use it. Signed-off-by: Thomas Petazzoni Tested-by: Atharva Lele Acked-by: Atharva Lele Signed-off-by: Thomas Petazzoni --- diff --git a/utils/genrandconfig b/utils/genrandconfig index aa5e151b7f..859996cfd5 100755 --- a/utils/genrandconfig +++ b/utils/genrandconfig @@ -198,7 +198,7 @@ def is_toolchain_usable(configfile, config): return True -def fixup_config(configfile): +def fixup_config(sysinfo, configfile): """Finalize the configuration and reject any problematic combinations This function returns 'True' when the configuration has been @@ -207,7 +207,6 @@ def fixup_config(configfile): generated). """ - sysinfo = SystemInfo() with open(configfile) as configf: configlines = configf.readlines() @@ -331,6 +330,8 @@ def gen_config(args): packages. """ + sysinfo = SystemInfo() + # Select a random toolchain configuration configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) @@ -403,7 +404,7 @@ def gen_config(args): "KCONFIG_PROBABILITY=%d" % randint(1, 30), "randpackageconfig"]) - if fixup_config(configfile): + if fixup_config(sysinfo, configfile): break subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,