Harness: pass correct cmdline arguments to cpudriver
authorReto Achermann <reto.achermann@inf.ethz.ch>
Tue, 14 Mar 2017 16:38:49 +0000 (17:38 +0100)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Tue, 14 Mar 2017 16:38:49 +0000 (17:38 +0100)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

tools/harness/barrelfish.py
tools/harness/machines/__init__.py

index c720970..3281419 100644 (file)
@@ -23,7 +23,6 @@ class BootModules(object):
         self.kernel = os.path.join(prefix, kernel)
         self.kernelArgs = []
         self.cpu_driver = None
-        self.cpu_driver_args = []
         self.boot_driver = None
         self.boot_driver_args = []
         self.modules = []
@@ -42,22 +41,21 @@ class BootModules(object):
     def set_cpu_driver(self, cpu_driver, args=[]):
         if cpu_driver == None :
             self.cpu_driver = None
+            self.kernelArgs = []
         else :
             self.cpu_driver = os.path.join(self.prefix, cpu_driver)
-        self.cpu_driver_args = args
-
-    def add_cpu_driver_args(self, args):
-        self.kernelArgs.extend(args)
+            self.kernelArgs = args
             
     def set_boot_driver(self, boot_driver,  args=[]):
         if boot_driver == None :
             self.boot_driver = None
+            self.boot_driver_args = []
         else :
             self.boot_driver = os.path.join(self.prefix, boot_driver);
-        self.boot_driver_args = args
+            self.boot_driver_args = args
     
     def set_boot_driver_args(self, args):
-        self.boot_driver_args = args
+        self.boot_driver_args.extend(args)
 
     def set_hypervisor(self, h):
         self.hypervisor = h
@@ -95,8 +93,8 @@ class BootModules(object):
             r += "bootdriver %s %s\n" % (
                 os.path.join(path, self.boot_driver), " ".join(self.boot_driver_args))
         if self.cpu_driver :
-            r += "kernel %s %s\n" % (
-                os.path.join(path, self.cpu_driver), " ".join(self.cpu_driver_args))
+            r += "cpudriver %s %s\n" % (
+                os.path.join(path, self.cpu_driver), " ".join(self.kernelArgs))
         if self.hypervisor:
             r += "hypervisor %s\n" % os.path.join(path, self.prefix, self.hypervisor)
         
index e9e36a8..f29f65e 100644 (file)
@@ -220,12 +220,12 @@ class Machine(object):
         if a == "armv7" :
             m.add_module("cpu_%s" % machine.get_platform(), machine.get_kernel_args())
         elif a == "armv8" :
+            # remove kernel
+            m.set_kernel(None)
             # add cpu driver
             m.set_cpu_driver(kernel, machine.get_kernel_args)
             # add boot driver
             m.set_boot_driver(machine.get_boot_driver())
-            # remove kernel
-            m.set_kernel(None)
         else :
             m.add_module("cpu", machine.get_kernel_args())