...
 
Commits (7)
......@@ -761,6 +761,13 @@ def handle_start(msg, jobs, sock, master, zmq_config):
return
LOG.info("master => START(%d)", job_id)
try:
if dispatcher_config == "":
with open("/etc/lava-dispatcher/dispatcher.yaml") as f:
dispatcher_config = f.read()
except FileNotFoundError:
pass
# Check if the job is known and started. In this case, send
# back the right signal (ignoring the duplication or signaling
# the end of the job).
......
......@@ -82,12 +82,15 @@ class ApplyOverlayGuest(Action):
self.set_namespace_data(
action=self.name, label="guest", key="filename", value=guest_file
)
lava_test_results_dir = self.get_namespace_data(
action='test', label='results', key='lava_test_results_dir')
blkid = prepare_guestfs(
guest_file,
overlay_file,
self.job.device["actions"]["deploy"]["methods"]["image"]["parameters"][
"guest"
]["size"],
lava_test_results_dir
)
self.results = {"success": blkid}
self.set_namespace_data(
......
......@@ -236,7 +236,7 @@ class PrepareFITAction(Action):
"-T",
"kernel",
"-C",
"None",
params.get("compression", "none"),
"-d",
params["kernel"],
"-a",
......@@ -259,10 +259,19 @@ class PrepareFITAction(Action):
)
for label in ["kernel", "dtb", "ramdisk"]
}
fit_path = os.path.join(os.path.dirname(params["kernel"]), "image.itb")
kernel_path = params["kernel"]
kernel_dir, kernel_image = os.path.split(kernel_path)
arch = self.deploy_params["mkimage_arch"]
if arch == "arm64":
lzma_kernel = os.path.join(kernel_dir, ".".join([kernel_image, "lzma"]))
self.run_cmd(["lzma", "--keep", kernel_path])
params.update({"kernel": lzma_kernel, "compression": "lzma"})
fit_path = os.path.join(kernel_dir, "image.itb")
params.update(
{
"arch": self.deploy_params["mkimage_arch"],
"arch": arch,
"load_addr": self.device_params["load_address"],
"fit_path": fit_path,
}
......
......@@ -198,9 +198,9 @@ ubuntu = { # pylint: disable=invalid-name
"distro": "ubuntu",
"tar_flags": "--warning no-timestamp",
"lava_test_sh_cmd": "/bin/sh",
"lava_test_dir": "/lava-%s",
'lava_test_dir': '/var/lib/lava-%s',
"lava_test_results_part_attr": "root_part",
"lava_test_results_dir": "/lava-%s",
'lava_test_results_dir': '/var/lib/lava-%s',
"lava_test_shell_file": "~/.bashrc",
}
......
......@@ -104,7 +104,7 @@ class TestDepthchargeAction(StdoutTestCase):
-A {arch} \
-O linux \
-T kernel \
-C None \
-C none \
-d {kernel} \
-a {load_addr} \
-b {dtb} \
......
......@@ -124,9 +124,9 @@ def _launch_guestfs(guest):
@replace_exception(RuntimeError, JobError)
def prepare_guestfs(output, overlay, size):
def prepare_guestfs(output, overlay, size, target_mountpoint=""):
"""
Applies the overlay, offset by one directory.
Applies the overlay, offset by the target directory.
This allows the booted device to mount at the
original lava directory and retain the same path
as if the overlay was unpacked directly into the
......@@ -134,6 +134,7 @@ def prepare_guestfs(output, overlay, size):
:param output: filename of the temporary device
:param overlay: tarball of the lava test shell overlay.
:param size: size of the filesystem in Mb
:param target_mountpoint: path to the mount point on the host
:return blkid of the guest device
"""
guest = guestfs.GuestFS(python_return_dict=True)
......@@ -154,9 +155,10 @@ def prepare_guestfs(output, overlay, size):
guest_dir = mkdtemp()
guest_tar = os.path.join(guest_dir, "guest.tar")
root_tar = tarfile.open(guest_tar, "w")
for topdir in os.listdir(tar_output):
for dirname in os.listdir(os.path.join(tar_output, topdir)):
root_tar.add(os.path.join(tar_output, topdir, dirname), arcname=dirname)
target_mountpoint = target_mountpoint.lstrip("/")
topdir = os.path.join(tar_output, target_mountpoint)
for dirname in os.listdir(topdir):
root_tar.add(os.path.join(tar_output, topdir, dirname), arcname=dirname)
root_tar.close()
guest.tar_in(guest_tar, "/")
os.unlink(guest_tar)
......
......@@ -2,7 +2,7 @@
{% set console_device = console_device | default('ttyS0') %}
{% set baud_rate = baud_rate | default(115200) %}
{% set kernel_args = extra_kernel_args | default(base_kernel_args) %}
{% set kernel_args = [base_kernel_args, extra_kernel_args] | join(" ") %}
{% set base_depthcharge_commands = depthcharge_tftp_commands | default(
" - tftpboot {SERVER_IP} {FIT} {CMDLINE}
......
......@@ -2,14 +2,14 @@
{% extends 'd03.jinja2' %}
{% block grub_ramdisk %}
- 'linux (tftp,{SERVER_IP})/{KERNEL} pcie_aspm=off pci=pcie_bus_perf root=/dev/ram0 {{ base_ip_args }}'
- 'linux (tftp,{SERVER_IP})/{KERNEL} pcie_aspm=off pci=pcie_bus_perf acpi=force root=/dev/ram0 {{ base_ip_args }}'
- devicetree (tftp,{SERVER_IP})/{DTB}
- initrd (tftp,{SERVER_IP})/{RAMDISK}
- boot
{% endblock grub_ramdisk %}
{% block grub_nfs %}
- 'linux (tftp,{SERVER_IP})/{KERNEL} pcie_aspm=off pci=pcie_bus_perf root=/dev/nfs rw {{ base_nfsroot_args }} {{ base_ip_args }}'
- 'linux (tftp,{SERVER_IP})/{KERNEL} pcie_aspm=off pci=pcie_bus_perf acpi=force root=/dev/nfs rw {{ base_nfsroot_args }} {{ base_ip_args }}'
- devicetree (tftp,{SERVER_IP})/{DTB}
- boot
{% endblock grub_nfs %}
......@@ -4,4 +4,4 @@
{% set mkimage_fit_arch = 'arm' %}
{% set start_message = start_message | default('Starting netboot on veyron_jaq...') %}
{% set console_device = console_device | default('ttyS2') %}
{% set extra_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}
{% set base_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}
......@@ -5,4 +5,4 @@
{% set start_message = start_message | default('Starting depthcharge on gru...') %}
{% set bootloader_prompt = bootloader_prompt | default('gru:') %}
{% set console_device = console_device | default('ttyS2') %}
{% set extra_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}
{% set base_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}
......@@ -3,7 +3,7 @@
{% extends 'base-uboot.jinja2' %}
{% set bootm_kernel_addr = '0x01000000' %}
{% set bootm_ramdisk_addr = '0x02100000' %}
{% set bootm_ramdisk_addr = '0x02200000' %}
{% set bootm_dtb_addr = '0x00000100' %}
{% set bootz_kernel_addr = bootm_kernel_addr %}
{% set bootz_ramdisk_addr = bootm_ramdisk_addr %}
......
......@@ -5,4 +5,4 @@
{% set start_message = start_message | default('Starting depthcharge on nyan_big...') %}
{% set bootloader_prompt = bootloader_prompt | default('nyan_big:') %}
{% set console_device = console_device | default('ttyS0') %}
{% set extra_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}
{% set base_kernel_args = base_kernel_args | default('earlyprintk=ttyS2,115200n8 console=tty1') %}