diff --git a/build.mk b/build.mk
index 0067b4c91708374d6bed3401a323b8fdc1174e09..528cf48e10cc538e4ae5b0c8c36a11481c6a52a2 100644
--- a/build.mk
+++ b/build.mk
@@ -655,7 +655,7 @@ usr.img: bare.img $(out)/usr.manifest $(out)/cmdline
 	$(src)/scripts/upload_manifest.py -o $@ -m $(out)/usr.manifest \
 		-D jdkbase=$(jdkbase) -D gccbase=$(gccbase) -D \
 		glibcbase=$(glibcbase) -D miscbase=$(miscbase)
-	$(call quiet, $(src)/scripts/imgedit.py setargs $@ $(shell cat $(out)/cmdline), IMGEDIT $@)
+	$(call quiet, $(src)/scripts/imgedit.py setargs $@ "$(shell cat $(out)/cmdline)", IMGEDIT $@)
 
 $(jni): INCLUDES += -I /usr/lib/jvm/java/include -I /usr/lib/jvm/java/include/linux/
 
diff --git a/scripts/module.py b/scripts/module.py
index db4906016980fdc642b542258e4f0ab2480aad5d..67ec0a36fa0bd11344bbf494f9bebfeea56309a1 100755
--- a/scripts/module.py
+++ b/scripts/module.py
@@ -73,18 +73,14 @@ def generate_manifests(modules, basic_apps):
             for app in basic_apps:
                 app.prepare_manifest(resolve.get_build_path(), manifest_type, manifest)
 
-def get_command_line(basic_apps):
-    if not basic_apps:
-        raise Exception("No apps")
-
-    if len(basic_apps) > 1:
-        raise Exception("Running more than one basic app not supported")
-
-    cmdline = basic_apps[0].get_launcher_args()
-    if isinstance(cmdline, basestring):
-        return cmdline
+def format_args(args):
+    if isinstance(args, basestring):
+        return args
     else:
-        return ' '.join(cmdline)
+        return ' '.join(args)
+
+def get_command_line(basic_apps):
+    return '&'.join((format_args(app.get_launcher_args()) for app in basic_apps))
 
 def make_modules(modules):
     for module in modules: