mirror of
https://github.com/drasko/codezero.git
synced 2026-10-14 16:57:01 +02:00
Added conditional configuration flag -c to build.py
This commit is contained in:
@@ -16,12 +16,13 @@ from configure import *
|
|||||||
from config.parse_options import *
|
from config.parse_options import *
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
build_parse_options()
|
options, args = build_parse_options()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Configure
|
# Configure
|
||||||
#
|
#
|
||||||
configure_kernel(CML2_CML_FILE)
|
if options.config or not os.path.exists(CML2_OLDCONFIG_FILE):
|
||||||
|
configure_kernel(CML2_CML_FILE)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build the kernel
|
# Build the kernel
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ def build_parse_options():
|
|||||||
|
|
||||||
parser.add_option("-a", "--arch", type = "string", dest = "arch",
|
parser.add_option("-a", "--arch", type = "string", dest = "arch",
|
||||||
help = "Use configuration file for architecture")
|
help = "Use configuration file for architecture")
|
||||||
parser.add_option("-c", "--num-containers", type = "int", dest = "ncont",
|
parser.add_option("-n", "--num-containers", type = "int", dest = "ncont",
|
||||||
help = "Maximum number of containers that will be "
|
help = "Maximum number of containers that will be "
|
||||||
"made available in configuration")
|
"made available in configuration")
|
||||||
|
parser.add_option("-c", "--configure-first", action = "store_true", dest = "config",
|
||||||
|
help = "Tells the build script to run configurator first")
|
||||||
parser.add_option("-f", "--use-file", dest = "cml_file",
|
parser.add_option("-f", "--use-file", dest = "cml_file",
|
||||||
help = "Supply user-defined cml file "
|
help = "Supply user-defined cml file "
|
||||||
"(Use only if you want to override default)")
|
"(Use only if you want to override default)")
|
||||||
@@ -56,4 +58,4 @@ def build_parse_options():
|
|||||||
else:
|
else:
|
||||||
print "Deleting %s" % CML2_OLDCONFIG_FILE
|
print "Deleting %s" % CML2_OLDCONFIG_FILE
|
||||||
os.remove(CML2_OLDCONFIG_FILE)
|
os.remove(CML2_OLDCONFIG_FILE)
|
||||||
|
return options, args
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ int fileio(void)
|
|||||||
memset(filename, 0, 128);
|
memset(filename, 0, 128);
|
||||||
sprintf(filename, "/home/bahadir/newfile%d.txt", tid);
|
sprintf(filename, "/home/bahadir/newfile%d.txt", tid);
|
||||||
if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU)) < 0) {
|
if ((fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRWXU)) < 0) {
|
||||||
test_printf("OPEN: %d", errno);
|
test_printf("OPEN: %d", -errno);
|
||||||
|
test_printf("While trying to open %s\n", filename);
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
test_printf("%d: Created %s\n", tid, filename);
|
test_printf("%d: Created %s\n", tid, filename);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ int forktest(void)
|
|||||||
|
|
||||||
|
|
||||||
/* 16 forks */
|
/* 16 forks */
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 1; i++) {
|
||||||
test_printf("%d: Forking...\n", getpid());
|
test_printf("%d: Forking...\n", getpid());
|
||||||
if (fork() < 0)
|
if (fork() < 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def build_posix_container(projpaths, container):
|
|||||||
print POSIXDIR
|
print POSIXDIR
|
||||||
print '\nBuilding the Posix Container...'
|
print '\nBuilding the Posix Container...'
|
||||||
scons_cmd = 'scons ' + 'cont=' + str(container.id)
|
scons_cmd = 'scons ' + 'cont=' + str(container.id)
|
||||||
print "Issuing scons command: %s" % scons_cmd
|
#print "Issuing scons command: %s" % scons_cmd
|
||||||
os.system(scons_cmd)
|
os.system(scons_cmd)
|
||||||
builddir = source_to_builddir(POSIXDIR, container.id)
|
builddir = source_to_builddir(POSIXDIR, container.id)
|
||||||
os.path.walk(builddir, glob_by_walk, ['*.elf', images])
|
os.path.walk(builddir, glob_by_walk, ['*.elf', images])
|
||||||
|
|||||||
Reference in New Issue
Block a user