+ # Build the command line to be executed
+ # according the node type
+ def build_command(self, node_type, build_sh_spec, node_image, type, floppy_file, log_file):
+
+ command = ""
+
+ # regular node, make build's arguments
+ # and build the full command line to be called
+ if node_type == 'regular':
+
+ build_sh_options=""
+ if "cramfs" in build_sh_spec:
+ type += "_cramfs"
+ if "serial" in build_sh_spec:
+ build_sh_options += " -s %s"%build_sh_spec['serial']
+ if "variant" in build_sh_spec:
+ build_sh_options += " -V %s"%build_sh_spec['variant']
+
+ for karg in build_sh_spec['kargs']:
+ build_sh_options += ' -k "%s"'%karg
+
+ log_file="%s.log"%node_image
+
+ command = '%s -f "%s" -o "%s" -t "%s" %s &> %s' % (self.BOOTCDBUILD,
+ floppy_file,
+ node_image,
+ type,
+ build_sh_options,
+ log_file)
+ # dummynet node
+ elif node_type == 'dummynet':
+ # the build script expect the following parameters:
+ # the package base directory
+ # the working directory
+ # the full path of the configuration file
+ # the name of the resulting image file
+ # the type of the generated image
+ # the name of the log file
+ command = "%s -b %s -w %s -f %s -o %s -t %s -l %s" \
+ % (self.BOOTCDBUILD, self.BOOTCDDIR, self.WORKDIR,
+ floppy_file, node_image, type, log_file)
+ command = "touch %s %s; echo 'dummynet build script not yet supported'" \
+ % (log_file, node_image)
+
+ if self.DEBUG:
+ print "The build command line is %s" % command
+
+ return command
+