mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-27 21:26:36 +00:00
genrandconfig: calculate buildrootdir in __main__
This prepares for passing buildrootdir as an argument. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
2dc209be36
commit
9633b6ddd2
@ -328,9 +328,6 @@ def gen_config(args):
|
|||||||
packages.
|
packages.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
idir = "instance-%d" % args.instance
|
|
||||||
srcdir = os.path.join(idir, "buildroot")
|
|
||||||
|
|
||||||
# Select a random toolchain configuration
|
# Select a random toolchain configuration
|
||||||
configs = get_toolchain_configs(args.toolchains_url)
|
configs = get_toolchain_configs(args.toolchains_url)
|
||||||
|
|
||||||
@ -358,7 +355,7 @@ def gen_config(args):
|
|||||||
with open(os.path.join(args.outputdir, ".config"), "w+") as configf:
|
with open(os.path.join(args.outputdir, ".config"), "w+") as configf:
|
||||||
configf.writelines(configlines)
|
configf.writelines(configlines)
|
||||||
|
|
||||||
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", srcdir,
|
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
||||||
"olddefconfig"])
|
"olddefconfig"])
|
||||||
|
|
||||||
if not is_toolchain_usable(args.outputdir, config):
|
if not is_toolchain_usable(args.outputdir, config):
|
||||||
@ -375,17 +372,17 @@ def gen_config(args):
|
|||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
bounded_loop -= 1
|
bounded_loop -= 1
|
||||||
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", srcdir,
|
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
||||||
"KCONFIG_PROBABILITY=%d" % randint(1, 30),
|
"KCONFIG_PROBABILITY=%d" % randint(1, 30),
|
||||||
"randpackageconfig"])
|
"randpackageconfig"])
|
||||||
|
|
||||||
if fixup_config(args.outputdir):
|
if fixup_config(args.outputdir):
|
||||||
break
|
break
|
||||||
|
|
||||||
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", srcdir,
|
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
||||||
"olddefconfig"])
|
"olddefconfig"])
|
||||||
|
|
||||||
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", srcdir,
|
subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
|
||||||
"savedefconfig"])
|
"savedefconfig"])
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
@ -410,12 +407,13 @@ if __name__ == '__main__':
|
|||||||
# Buildroot sources, but to the location of the autobuilder
|
# Buildroot sources, but to the location of the autobuilder
|
||||||
# script.
|
# script.
|
||||||
args.outputdir = os.path.abspath(os.path.join(idir, "output"))
|
args.outputdir = os.path.abspath(os.path.join(idir, "output"))
|
||||||
|
args.buildrootdir = os.path.join(idir, "buildroot")
|
||||||
|
|
||||||
if not os.path.exists(idir):
|
if not os.path.exists(idir):
|
||||||
os.mkdir(idir)
|
os.mkdir(idir)
|
||||||
os.mkdir(args.outputdir)
|
os.mkdir(args.outputdir)
|
||||||
# gen_config expects "buildroot" directory under idir
|
# gen_config expects "buildroot" directory under idir
|
||||||
os.symlink("..", os.path.join(idir, "buildroot"))
|
os.symlink("..", args.buildrootdir)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ret = gen_config(args)
|
ret = gen_config(args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user