diff --git a/build.py b/build.py index 73c0742..a058421 100755 --- a/build.py +++ b/build.py @@ -16,12 +16,13 @@ from configure import * from config.parse_options import * def main(): - build_parse_options() + options, args = build_parse_options() # # 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 diff --git a/config/parse_options.py b/config/parse_options.py index 764d2d4..adae0dd 100644 --- a/config/parse_options.py +++ b/config/parse_options.py @@ -18,9 +18,11 @@ def build_parse_options(): parser.add_option("-a", "--arch", type = "string", dest = "arch", 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 " "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", help = "Supply user-defined cml file " "(Use only if you want to override default)") @@ -56,4 +58,4 @@ def build_parse_options(): else: print "Deleting %s" % CML2_OLDCONFIG_FILE os.remove(CML2_OLDCONFIG_FILE) - + return options, args diff --git a/conts/posix/test0/src/fileio.c b/conts/posix/test0/src/fileio.c index b5aabe3..7d9c3c0 100644 --- a/conts/posix/test0/src/fileio.c +++ b/conts/posix/test0/src/fileio.c @@ -23,7 +23,8 @@ int fileio(void) memset(filename, 0, 128); sprintf(filename, "/home/bahadir/newfile%d.txt", tid); 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; } test_printf("%d: Created %s\n", tid, filename); diff --git a/conts/posix/test0/src/forktest.c b/conts/posix/test0/src/forktest.c index 204b83e..9780685 100644 --- a/conts/posix/test0/src/forktest.c +++ b/conts/posix/test0/src/forktest.c @@ -17,7 +17,7 @@ int forktest(void) /* 16 forks */ - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 1; i++) { test_printf("%d: Forking...\n", getpid()); if (fork() < 0) goto out_err; diff --git a/scripts/conts/containers.py b/scripts/conts/containers.py index bc79895..0d36dac 100755 --- a/scripts/conts/containers.py +++ b/scripts/conts/containers.py @@ -53,7 +53,7 @@ def build_posix_container(projpaths, container): print POSIXDIR print '\nBuilding the Posix Container...' 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) builddir = source_to_builddir(POSIXDIR, container.id) os.path.walk(builddir, glob_by_walk, ['*.elf', images])