mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
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 <thomas.petazzoni@bootlin.com> Tested-by: Atharva Lele <itsatharva@gmail.com> Acked-by: Atharva Lele <itsatharva@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
parent
57f85e52a7
commit
4693676ec5
@ -198,7 +198,7 @@ def is_toolchain_usable(configfile, config):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def fixup_config(configfile):
|
def fixup_config(sysinfo, configfile):
|
||||||
"""Finalize the configuration and reject any problematic combinations
|
"""Finalize the configuration and reject any problematic combinations
|
||||||
|
|
||||||
This function returns 'True' when the configuration has been
|
This function returns 'True' when the configuration has been
|
||||||
@ -207,7 +207,6 @@ def fixup_config(configfile):
|
|||||||
generated).
|
generated).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sysinfo = SystemInfo()
|
|
||||||
with open(configfile) as configf:
|
with open(configfile) as configf:
|
||||||
configlines = configf.readlines()
|
configlines = configf.readlines()
|
||||||
|
|
||||||
@ -331,6 +330,8 @@ def gen_config(args):
|
|||||||
packages.
|
packages.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
sysinfo = SystemInfo()
|
||||||
|
|
||||||
# Select a random toolchain configuration
|
# Select a random toolchain configuration
|
||||||
configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
|
configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
|
||||||
|
|
||||||
@ -403,7 +404,7 @@ def gen_config(args):
|
|||||||
"KCONFIG_PROBABILITY=%d" % randint(1, 30),
|
"KCONFIG_PROBABILITY=%d" % randint(1, 30),
|
||||||
"randpackageconfig"])
|
"randpackageconfig"])
|
||||||
|
|
||||||
if fixup_config(configfile):
|
if fixup_config(sysinfo, configfile):
|
||||||
break
|
break
|
||||||
|
|
||||||
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user