summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Baker <tyler.baker@linaro.org>2015-04-03 17:02:17 (GMT)
committerTyler Baker <tyler.baker@linaro.org>2015-04-03 17:02:17 (GMT)
commit0142bf130ce5f062b789a8229a0ea1c6aa9e1faf (patch)
tree4d2ed61aa0c046e6513313cb86b553e2a06ebbd2
parent90bb05862865327b410ed4a142b0e58f5791be2c (diff)
downloadlava-dispatcher-0142bf130ce5f062b789a8229a0ea1c6aa9e1faf.tar.gz
lava-dispatcher-0142bf130ce5f062b789a8229a0ea1c6aa9e1faf.tar.xz
overlays: replace modules support with a generic interface
Change-Id: Id437f83ef852b2a21c5fea5a8da68a3c5e6dbef6
-rw-r--r--lava_dispatcher/actions/deploy.py15
-rw-r--r--lava_dispatcher/client/base.py8
-rw-r--r--lava_dispatcher/device/bootloader.py27
-rw-r--r--lava_dispatcher/device/dynamic_vm.py11
-rw-r--r--lava_dispatcher/device/fastboot.py11
-rw-r--r--lava_dispatcher/device/fastboot_drivers.py27
-rw-r--r--lava_dispatcher/device/fastmodel.py19
-rw-r--r--lava_dispatcher/device/jtag.py11
-rw-r--r--lava_dispatcher/device/jtag_drivers.py28
-rw-r--r--lava_dispatcher/device/master.py2
-rw-r--r--lava_dispatcher/device/qemu.py18
-rw-r--r--lava_dispatcher/device/target.py3
-rw-r--r--lava_dispatcher/device/vexpress.py9
-rw-r--r--lava_dispatcher/utils.py14
14 files changed, 98 insertions, 105 deletions
diff --git a/lava_dispatcher/actions/deploy.py b/lava_dispatcher/actions/deploy.py
index c6e3b92..0bba34c 100644
--- a/lava_dispatcher/actions/deploy.py
+++ b/lava_dispatcher/actions/deploy.py
@@ -197,7 +197,8 @@ class cmd_deploy_linaro_kernel(BaseAction):
'kernel': {'type': 'string', 'optional': False},
'ramdisk': {'type': 'string', 'optional': True},
'dtb': {'type': 'string', 'optional': True},
- 'modules': {'type': 'string', 'optional': True},
+ 'overlays': {'type': 'array', 'items': {'type': 'string'},
+ 'optional': True},
'rootfs': {'type': 'string', 'optional': True},
'nfsrootfs': {'type': 'string', 'optional': True},
'bootloader': {'type': 'string', 'optional': True},
@@ -241,7 +242,7 @@ class cmd_deploy_linaro_kernel(BaseAction):
prompt when specifying login commands')
def run(self,
- kernel=None, ramdisk=None, dtb=None, modules=None, rootfs=None,
+ kernel=None, ramdisk=None, dtb=None, overlays=None, rootfs=None,
nfsrootfs=None, bootloader=None, firmware=None, bl1=None, bl2=None,
bl31=None, rootfstype='ext4', bootloadertype='u_boot', target_type='oe',
login_prompt=None, password_prompt=None, username=None,
@@ -256,12 +257,10 @@ class cmd_deploy_linaro_kernel(BaseAction):
self.client.config.password = password
if login_commands is not None:
self.client.config.login_commands = login_commands
- self.client.deploy_linaro_kernel(
- kernel=kernel, ramdisk=ramdisk, dtb=dtb, modules=modules,
- rootfs=rootfs, nfsrootfs=nfsrootfs, bootloader=bootloader,
- firmware=firmware, bl1=bl1, bl2=bl2, bl31=bl31,
- rootfstype=rootfstype, bootloadertype=bootloadertype,
- target_type=target_type)
+ self.client.deploy_linaro_kernel(kernel=kernel, ramdisk=ramdisk, dtb=dtb, overlays=overlays, rootfs=rootfs,
+ nfsrootfs=nfsrootfs, bootloader=bootloader, firmware=firmware, bl1=bl1,
+ bl2=bl2, bl31=bl31, rootfstype=rootfstype, bootloadertype=bootloadertype,
+ target_type=target_type)
cmd_deploy_kernel = cmd_deploy_linaro_kernel
diff --git a/lava_dispatcher/client/base.py b/lava_dispatcher/client/base.py
index 04ac57c..b307d66 100644
--- a/lava_dispatcher/client/base.py
+++ b/lava_dispatcher/client/base.py
@@ -402,13 +402,11 @@ class LavaClient(object):
self.target_device.deploy_linaro_prebuilt(image, dtb, rootfstype,
bootloadertype)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs,
nfsrootfs, bootloader, firmware, bl1, bl2, bl31,
rootfstype, bootloadertype, target_type):
- self.target_device.deploy_linaro_kernel(kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware,
- bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type)
+ self.target_device.deploy_linaro_kernel(kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware,
+ bl1, bl2, bl31, rootfstype, bootloadertype, target_type)
@contextlib.contextmanager
def runner(self):
diff --git a/lava_dispatcher/device/bootloader.py b/lava_dispatcher/device/bootloader.py
index 9c8267d..fac877f 100644
--- a/lava_dispatcher/device/bootloader.py
+++ b/lava_dispatcher/device/bootloader.py
@@ -31,7 +31,7 @@ from lava_dispatcher.client.base import (
from lava_dispatcher.utils import (
finalize_process,
connect_to_serial,
- extract_modules,
+ extract_overlay,
extract_ramdisk,
create_ramdisk,
ensure_directory,
@@ -155,8 +155,7 @@ class BootloaderTarget(MasterImageTarget):
else:
raise CriticalError("Unknown bootloader type")
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware, bl1, bl2,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
bl31, rootfstype, bootloadertype, target_type):
if self.__deployment_data__ is None:
# Get deployment data
@@ -199,13 +198,14 @@ class BootloaderTarget(MasterImageTarget):
ramdisk = download_image(ramdisk, self.context,
self._tmpdir,
decompress=False)
- if modules is not None:
- modules = download_image(modules, self.context,
- self._tmpdir,
- decompress=False)
+ if overlays is not None:
ramdisk_dir = extract_ramdisk(ramdisk, self._tmpdir,
is_uboot=self._is_uboot_ramdisk(ramdisk))
- extract_modules(modules, ramdisk_dir)
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ self._tmpdir,
+ decompress=False)
+ extract_overlay(overlay, ramdisk_dir)
ramdisk = create_ramdisk(ramdisk_dir, self._tmpdir)
if self._is_uboot():
# Ensure ramdisk has u-boot header
@@ -243,11 +243,12 @@ class BootloaderTarget(MasterImageTarget):
self._lava_nfsrootfs = self._setup_nfs(nfsrootfs, self._tmpdir)
self._default_boot_cmds = 'boot_cmds_nfs'
self._boot_tags['{NFSROOTFS}'] = self._lava_nfsrootfs
- if modules is not None and ramdisk is None:
- modules = download_image(modules, self.context,
- self._tmpdir,
- decompress=False)
- extract_modules(modules, self._lava_nfsrootfs)
+ if overlays is not None and ramdisk is None:
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ self._tmpdir,
+ decompress=False)
+ extract_overlay(overlay, self._lava_nfsrootfs)
if bootloader is not None:
# We have been passed a bootloader
bootloader = download_image(bootloader, self.context,
diff --git a/lava_dispatcher/device/dynamic_vm.py b/lava_dispatcher/device/dynamic_vm.py
index 4a72f45..cf086f8 100644
--- a/lava_dispatcher/device/dynamic_vm.py
+++ b/lava_dispatcher/device/dynamic_vm.py
@@ -70,13 +70,10 @@ class DynamicVmTarget(Target):
self.backend_adapter.amend_config()
return self.backend.power_on()
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type):
- self.backend.deploy_linaro_kernel(kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware,
- bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type)
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
+ bl31, rootfstype, bootloadertype, target_type):
+ self.backend.deploy_linaro_kernel(kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1,
+ bl2, bl31, rootfstype, bootloadertype, target_type)
self.backend_adapter.copy_images()
def deploy_linaro_prebuilt(self, image, dtb, rootfstype, bootloadertype):
diff --git a/lava_dispatcher/device/fastboot.py b/lava_dispatcher/device/fastboot.py
index 06c2e68..32056ed 100644
--- a/lava_dispatcher/device/fastboot.py
+++ b/lava_dispatcher/device/fastboot.py
@@ -59,9 +59,8 @@ class FastbootTarget(Target):
self.driver = driver_class(self)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type):
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
+ bl31, rootfstype, bootloadertype, target_type):
self._target_type = target_type
self._use_boot_cmds = True
if rootfs is not None:
@@ -75,9 +74,9 @@ class FastbootTarget(Target):
while (attempts < deploy_attempts) and (not deployed):
logging.info("Deploying test image. Attempt: %d", attempts + 1)
try:
- self.driver.deploy_linaro_kernel(kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, self._target_type, self.scratch_dir)
+ self.driver.deploy_linaro_kernel(kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader,
+ firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
+ self._target_type)
deployed = True
except (subprocess.CalledProcessError, pexpect.TIMEOUT) as e:
msg = "Deployment failed: %s" % e
diff --git a/lava_dispatcher/device/fastboot_drivers.py b/lava_dispatcher/device/fastboot_drivers.py
index d8feaf7..5c22f8d 100644
--- a/lava_dispatcher/device/fastboot_drivers.py
+++ b/lava_dispatcher/device/fastboot_drivers.py
@@ -33,7 +33,7 @@ from lava_dispatcher.utils import (
mkdtemp,
connect_to_serial,
extract_ramdisk,
- extract_modules,
+ extract_overlay,
create_ramdisk,
append_dtb,
prepend_blob,
@@ -162,7 +162,7 @@ class BaseDriver(object):
def finalize(self, proc):
finalize_process(proc)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, target_type, scratch_dir):
self.target_type = target_type
@@ -182,13 +182,14 @@ class BaseDriver(object):
self._ramdisk = download_image(ramdisk, self.context,
self._working_dir,
decompress=False)
- if modules is not None:
- modules = download_image(modules, self.context,
- self._working_dir,
- decompress=False)
+ if overlays is not None:
ramdisk_dir = extract_ramdisk(self._ramdisk, self.working_dir,
is_uboot=False)
- extract_modules(modules, ramdisk_dir)
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ self._working_dir,
+ decompress=False)
+ extract_overlay(overlay, ramdisk_dir)
self._ramdisk = create_ramdisk(ramdisk_dir, self.working_dir)
if dtb is not None:
dtb = download_image(dtb, self.context,
@@ -292,7 +293,7 @@ class fastboot(BaseDriver):
def __init__(self, device):
super(fastboot, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
@@ -315,7 +316,7 @@ class nexus10(fastboot):
def __init__(self, device):
super(nexus10, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
@@ -350,7 +351,7 @@ class capri(fastboot_serial):
def __init__(self, device):
super(capri, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
@@ -390,7 +391,7 @@ class pxa1928dkb(fastboot_serial):
def __init__(self, device):
super(pxa1928dkb, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
@@ -419,7 +420,7 @@ class k3v2(fastboot_serial):
def __init__(self, device):
super(k3v2, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
@@ -439,7 +440,7 @@ class tshark(fastboot):
def __init__(self, device):
super(tshark, self).__init__(device)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
target_type, scratch_dir):
raise CriticalError('This platform does not support kernel deployment!')
diff --git a/lava_dispatcher/device/fastmodel.py b/lava_dispatcher/device/fastmodel.py
index 63abe34..693c366 100644
--- a/lava_dispatcher/device/fastmodel.py
+++ b/lava_dispatcher/device/fastmodel.py
@@ -1,4 +1,5 @@
# Copyright (C) 2012 Linaro Limited
+# Copyright (C) 2012 Linaro Limited
#
# Author: Andy Doan <andy.doan@linaro.org>
#
@@ -54,7 +55,7 @@ from lava_dispatcher.utils import (
extract_tar,
DrainConsoleOutput,
finalize_process,
- extract_modules,
+ extract_overlay,
extract_ramdisk,
create_ramdisk,
ensure_directory,
@@ -267,9 +268,8 @@ class FastModelTarget(Target):
self._copy_needed_files_from_partition(self.config.root_part, 'boot')
self._copy_needed_files_from_partition(self.config.root_part, 'lib')
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type):
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
+ bl31, rootfstype, bootloadertype, target_type):
# Required
if kernel is None:
raise CriticalError("A kernel image is required")
@@ -288,13 +288,14 @@ class FastModelTarget(Target):
self._boot_tags['{KERNEL}'] = os.path.relpath(self._kernel, self._scratch_dir)
self._initrd = download_image(ramdisk, self.context, self._scratch_dir,
decompress=False)
- if modules is not None:
- modules = download_image(modules, self.context,
- self._scratch_dir,
- decompress=False)
+ if overlays is not None:
ramdisk_dir = extract_ramdisk(self._initrd, self._scratch_dir,
is_uboot=self._is_uboot_ramdisk(ramdisk))
- extract_modules(modules, ramdisk_dir)
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ self._scratch_dir,
+ decompress=False)
+ extract_overlay(overlay, ramdisk_dir)
self._initrd = create_ramdisk(ramdisk_dir, self._scratch_dir)
self._boot_tags['{RAMDISK}'] = os.path.relpath(self._initrd, self._scratch_dir)
self._dtb = download_image(dtb, self.context, self._scratch_dir,
diff --git a/lava_dispatcher/device/jtag.py b/lava_dispatcher/device/jtag.py
index 8f012bc..1057180 100644
--- a/lava_dispatcher/device/jtag.py
+++ b/lava_dispatcher/device/jtag.py
@@ -55,16 +55,13 @@ class JtagTarget(Target):
self.driver = driver_class(self)
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type):
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
+ bl31, rootfstype, bootloadertype, target_type):
# Get deployment data
self.deployment_data = deployment_data.get(target_type)
self._boot_tags, self._default_boot_cmds = \
- self.driver.deploy_linaro_kernel(kernel, ramdisk, dtb, modules,
- rootfs, nfsrootfs, bootloader,
- firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type, self.scratch_dir)
+ self.driver.deploy_linaro_kernel(kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware,
+ bl1, bl2, bl31, rootfstype, bootloadertype, target_type)
def power_on(self):
self._boot_cmds = self._load_boot_cmds(default=self._default_boot_cmds,
diff --git a/lava_dispatcher/device/jtag_drivers.py b/lava_dispatcher/device/jtag_drivers.py
index 3bdbc4e..9f40e06 100644
--- a/lava_dispatcher/device/jtag_drivers.py
+++ b/lava_dispatcher/device/jtag_drivers.py
@@ -32,7 +32,7 @@ from lava_dispatcher.utils import (
connect_to_serial,
extract_rootfs,
extract_ramdisk,
- extract_modules,
+ extract_overlay,
create_ramdisk
)
@@ -47,7 +47,7 @@ class BaseDriver(object):
self.config = device.config
self._default_boot_cmds = 'boot_cmds_ramdisk'
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, target_type, scratch_dir):
"""
@@ -71,7 +71,7 @@ class stmc(BaseDriver):
self._boot_tags = {}
self._booted = False
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs,
bootloader, firmware, bl1, bl2, bl31, rootfstype,
bootloadertype, target_type, scratch_dir):
kernel_url = kernel
@@ -94,13 +94,14 @@ class stmc(BaseDriver):
ramdisk = download_image(ramdisk, self.context,
scratch_dir,
decompress=False)
- if modules is not None:
- modules = download_image(modules, self.context,
- scratch_dir,
- decompress=False)
+ if overlays is not None:
ramdisk_dir = extract_ramdisk(ramdisk, scratch_dir,
is_uboot=False)
- extract_modules(modules, ramdisk_dir)
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ scratch_dir,
+ decompress=False)
+ extract_overlay(overlay, ramdisk_dir)
ramdisk = create_ramdisk(ramdisk_dir, scratch_dir)
stmc_command = ' '.join([stmc_command,
self.config.jtag_stmc_ramdisk_command.format(RAMDISK=ramdisk)])
@@ -120,11 +121,12 @@ class stmc(BaseDriver):
extract_rootfs(nfsrootfs, lava_nfsrootfs)
self._boot_tags['{NFSROOTFS}'] = lava_nfsrootfs
self._default_boot_cmds = 'boot_cmds_nfs'
- if modules is not None and ramdisk is None:
- modules = download_image(modules, self.context,
- scratch_dir,
- decompress=False)
- extract_modules(modules, lava_nfsrootfs)
+ if overlays is not None and ramdisk is None:
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ scratch_dir,
+ decompress=False)
+ extract_overlay(overlay, lava_nfsrootfs)
# Add suffix for boot commands
self._stmc_command = stmc_command + ' --'
diff --git a/lava_dispatcher/device/master.py b/lava_dispatcher/device/master.py
index 7a6392b..40f450f 100644
--- a/lava_dispatcher/device/master.py
+++ b/lava_dispatcher/device/master.py
@@ -91,7 +91,7 @@ class MasterImageTarget(Target):
self.master_kernel = None
self.master_ramdisk = None
- self.master_modules = None
+ self.master_overlays = None
self.master_dtb = None
self.master_firmware = None
self.master_nfsrootfs = None
diff --git a/lava_dispatcher/device/qemu.py b/lava_dispatcher/device/qemu.py
index d4212ea..dbb260d 100644
--- a/lava_dispatcher/device/qemu.py
+++ b/lava_dispatcher/device/qemu.py
@@ -39,7 +39,7 @@ from lava_dispatcher.utils import (
extract_tar,
finalize_process,
extract_ramdisk,
- extract_modules,
+ extract_overlay,
create_ramdisk
)
from lava_dispatcher.errors import (
@@ -72,9 +72,8 @@ class QEMUTarget(Target):
self.context,
decompress=False))
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs, nfsrootfs,
- bootloader, firmware, bl1, bl2, bl31, rootfstype,
- bootloadertype, target_type):
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
+ bl31, rootfstype, bootloadertype, target_type):
# Check for errors
if rootfs is None and ramdisk is None:
raise CriticalError("You must specify a QEMU file system image or ramdisk")
@@ -90,13 +89,14 @@ class QEMUTarget(Target):
if ramdisk is not None:
ramdisk = download_image(ramdisk, self.context,
decompress=False)
- if modules is not None:
- modules = download_image(modules, self.context,
- self.scratch_dir,
- decompress=False)
+ if overlays is not None:
ramdisk_dir = extract_ramdisk(ramdisk, self.scratch_dir,
is_uboot=self._is_uboot_ramdisk(ramdisk))
- extract_modules(modules, ramdisk_dir)
+ for overlay in overlays:
+ overlay = download_image(overlay, self.context,
+ self.scratch_dir,
+ decompress=False)
+ extract_overlay(overlay, ramdisk_dir)
ramdisk = create_ramdisk(ramdisk_dir, self.scratch_dir)
self._ramdisk = ramdisk
if rootfs is None:
diff --git a/lava_dispatcher/device/target.py b/lava_dispatcher/device/target.py
index 0297cb9..98d1a2d 100644
--- a/lava_dispatcher/device/target.py
+++ b/lava_dispatcher/device/target.py
@@ -218,8 +218,7 @@ class Target(object):
def deploy_linaro_prebuilt(self, image, dtb, rootfstype, bootloadertype):
raise NotImplementedError('deploy_linaro_prebuilt')
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware, bl1, bl2,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
bl31, rootfstype, bootloadertype, target_type):
raise NotImplementedError('deploy_linaro_kernel')
diff --git a/lava_dispatcher/device/vexpress.py b/lava_dispatcher/device/vexpress.py
index 32865a4..d3251f4 100644
--- a/lava_dispatcher/device/vexpress.py
+++ b/lava_dispatcher/device/vexpress.py
@@ -83,8 +83,7 @@ class VexpressTarget(BootloaderTarget):
# methods inherited from BootloaderTarget and overriden here
##################################################################
- def deploy_linaro_kernel(self, kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware, bl1, bl2,
+ def deploy_linaro_kernel(self, kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader, firmware, bl1, bl2,
bl31, rootfstype, bootloadertype, target_type):
if bootloader is None:
if self.config.vexpress_uefi_default is None:
@@ -112,9 +111,9 @@ class VexpressTarget(BootloaderTarget):
decompress=False)
bl1 = None
- super(VexpressTarget, self).deploy_linaro_kernel(kernel, ramdisk, dtb, modules, rootfs,
- nfsrootfs, bootloader, firmware, bl1, bl2,
- bl31, rootfstype, bootloadertype, target_type)
+ super(VexpressTarget, self).deploy_linaro_kernel(kernel, ramdisk, dtb, overlays, rootfs, nfsrootfs, bootloader,
+ firmware, bl1, bl2, bl31, rootfstype, bootloadertype,
+ target_type)
def _load_test_firmware(self):
with self._mcc_setup() as mount_point:
diff --git a/lava_dispatcher/utils.py b/lava_dispatcher/utils.py
index 093b358..bbeca1b 100644
--- a/lava_dispatcher/utils.py
+++ b/lava_dispatcher/utils.py
@@ -147,14 +147,14 @@ def extract_rootfs(rootfs, root):
raise CriticalError('Unable to remove tarball: %s' % rootfs)
-def extract_modules(modules, root):
- """ Extracts the contents of a modules .tar.(bz2, gz, xz, lzma, etc) to the filesystem root.
+def extract_overlay(overlay, root):
+ """ Extracts the contents of a compressed tar (bz2, gz, xz, lzma, etc) to the filesystem root.
"""
- logging.info('Attempting to install modules onto the filesystem')
- if logging_system('nice tar --selinux -C %s -xaf %s' % (root, modules)):
- raise CriticalError('Unable to extract tarball: %s to %s' % (modules, root))
- if logging_system('rm %s' % modules):
- raise CriticalError('Unable to remove tarball: %s' % modules)
+ logging.info('Attempting to install overlay onto the filesystem')
+ if logging_system('nice tar --selinux -C %s -xaf %s' % (root, overlay)):
+ raise CriticalError('Unable to extract tarball: %s to %s' % (overlay, root))
+ if logging_system('rm %s' % overlay):
+ raise CriticalError('Unable to remove tarball: %s' % overlay)
def extract_ramdisk(ramdisk, tmpdir, is_uboot=False):