diff options
-rw-r--r-- | templates/base/agl-base-defaults.jinja2 | 44 | ||||
-rw-r--r-- | templates/boot/agl-prompt.jinja | 5 | ||||
-rw-r--r-- | templates/boot/generic-uboot-tftp.jinja2 | 11 | ||||
-rw-r--r-- | templates/machines/dra7xx-evm.jinja2 | 5 | ||||
-rw-r--r-- | templates/machines/m3ulcb.jinja2 | 5 | ||||
-rw-r--r-- | templates/machines/porter.jinja2 | 4 | ||||
-rw-r--r-- | templates/machines/qemux86-64.jinja2 | 2 | ||||
-rw-r--r-- | templates/machines/raspberrypi3.jinja2 | 11 | ||||
-rw-r--r-- | utils/agljobtemplate.py | 12 | ||||
-rwxr-xr-x | utils/create-jobs.py | 24 |
10 files changed, 78 insertions, 45 deletions
diff --git a/templates/base/agl-base-defaults.jinja2 b/templates/base/agl-base-defaults.jinja2 index 7f75a76..462fb86 100644 --- a/templates/base/agl-base-defaults.jinja2 +++ b/templates/base/agl-base-defaults.jinja2 @@ -18,27 +18,39 @@ {%- set rootfs_type = rootfs_type|default("ramdisk") %} {%- set vcs_branch = vcs_branch|default("agl-branch") %} {%- set vcs_url = vcs_url|default(baseurl()) %} -{%- if dtb %} -{%- set dtb_url = dtb_url|default(baseurl(dtb)) %} -{%- endif %} -{%- if modules %} -{%- set modules_compression = modules_compression|default(modules|get_extension) %} -{%- set modules_url = modules_url|default(baseurl(modules)) %} + +{# Kernel type definition #} +{%- if kernel_image|first|lower == "i" %} + {%- set kernel_type = "image" %} +{%- elif kernel_image|first|lower == "z" %} + {%- set kernel_type = "zimage" %} +{%- else %} + {%- set kernel_type = "uimage" %} {%- endif %} + +{# Image names definitions #} {%- if rootfs_type == 'nbd' %} -{%- set boot_commands = "nbd" %} -{%- set deploy_to = "nbd" %} -{%- set nbdinitrd = nbdinitrd|default("initramfs-netboot-image-" + yocto_machine +".ext4.gz") %} -{%- set nbdinitrd_url = nbdinitrd_url|default(baseurl(nbdinitrd)) %} -{%- set nbdroot = rfs_image|default("core-image-minimal-" + yocto_machine + ".ext4.xz") %} -{%- set nbdroot_compression = nbdroot_compression|default(nbdroot|get_extension) %} -{%- set nbdroot_url = nbdroot_url|default(baseurl(nbdroot)) %} + {%- set initrd = initrd|default("initramfs-netboot-image-" + yocto_machine +".ext4.gz") %} + {%- set boot_commands = "nbd" %} + {%- set deploy_to = "nbd" %} + {%- set rootfs = rfs_image|default("core-image-minimal-" + yocto_machine + ".ext4.xz") %} + {%- set rootfs_compression = (rootfs|get_extension) %} + {%- set rootfs_url = rootfs_url|default(baseurl(rootfs)) %} {%- elif rootfs_type == 'ramdisk' %} -{%- set initrd = rfs_image|default("initramfs-boot-image-" + yocto_machine + ".gz") %} -{%- set initrd_compression = initrd_compression|default(initrd|get_extension) %} + {%- set initrd = rfs_image|default("initramfs-boot-image-" + yocto_machine + ".gz") %} {%- endif %} -{%- if initrd %} + +{%- set initrd_compression = (initrd|get_extension) %} {%- set initrd_url = initrd_url|default(baseurl(initrd)) %} + +{%- if modules %} + {%- set modules_compression = (modules|get_extension) %} + {%- set modules_url = modules_url|default(baseurl(modules)) %} +{%- endif %} + +{%- if dtb %} + {%- set dtb_url = dtb_url|default(baseurl(dtb)) %} {%- endif %} + {%- block job %} {%- endblock %} diff --git a/templates/boot/agl-prompt.jinja b/templates/boot/agl-prompt.jinja index 9d8cd50..731434b 100644 --- a/templates/boot/agl-prompt.jinja +++ b/templates/boot/agl-prompt.jinja @@ -1,5 +1,8 @@ - prompts: ["root@{{ yocto_machine }}:~"] + prompts: + - "root@{{ yocto_machine }}:~" + - '/ #' + auto_login: login_prompt: "login:" username: root diff --git a/templates/boot/generic-uboot-tftp.jinja2 b/templates/boot/generic-uboot-tftp.jinja2 index a7fa6ce..4baa405 100644 --- a/templates/boot/generic-uboot-tftp.jinja2 +++ b/templates/boot/generic-uboot-tftp.jinja2 @@ -10,7 +10,6 @@ protocols: {% endblock %} {%- block boot %} {{ super() }} - type: {{ uboot_type|default("bootm") }} commands: {{ boot_commands|default("ramdisk") }} {%- if rootfs_type == 'nbd' %} transfer_overlay: @@ -22,15 +21,15 @@ protocols: {{ super() }} kernel: url: {{ kernel_url }} + type: {{ kernel_type }} {%- if rootfs_type == 'nbd' %} initrd: - url: {{ nbdinitrd_url }} + url: {{ initrd_url }} allow_modify: false nbdroot: - url: {{ nbdroot_url }} - compression: {{ nbdroot_compression }} -{%- endif %} -{%- if initrd_url and rootfs_type != 'nbd' %} + url: {{ rootfs_url }} + compression: {{ rootfs_compression }} +{%- elif rootfs_type == 'ramdisk' %} ramdisk: url: {{ initrd_url }} compression: {{ initrd_compression }} diff --git a/templates/machines/dra7xx-evm.jinja2 b/templates/machines/dra7xx-evm.jinja2 index b4f4f34..98ce0ed 100644 --- a/templates/machines/dra7xx-evm.jinja2 +++ b/templates/machines/dra7xx-evm.jinja2 @@ -1,6 +1,5 @@ {%- extends 'boot/generic-uboot-tftp.jinja2' %} {%- set device_type = "ti-vayu-uboot" %} -{%- set dtb = "zImage-dra7-evm-lcd-lg.dtb" %} -{%- set kernel_image = "zImage" %} +{%- set dtb = dtb|default("zImage-dra7-evm-lcd-lg.dtb") %} +{%- set kernel_image = kernel_image|default("zImage") %} {%- set rootfs_type = rootfs_type|default("nbd") %} -{%- set uboot_type = "bootz" %} diff --git a/templates/machines/m3ulcb.jinja2 b/templates/machines/m3ulcb.jinja2 index 568706e..9118deb 100644 --- a/templates/machines/m3ulcb.jinja2 +++ b/templates/machines/m3ulcb.jinja2 @@ -3,7 +3,6 @@ {%- set device_mach = "renesas" %} {%- set device_type = "r8a7796-m3ulcb" %} {%- set dl_dir = "m3ulcb-nogfx" %} -{%- set dtb = "Image-r8a7796-m3ulcb.dtb" %} -{%- set kernel_image = "Image" %} +{%- set dtb = dtb|default("Image-r8a7796-m3ulcb.dtb") %} +{%- set kernel_image = kernel_image|default("Image") %} {%- set rootfs_type = rootfs_type|default("nbd") %} -{%- set uboot_type = "booti" %} diff --git a/templates/machines/porter.jinja2 b/templates/machines/porter.jinja2 index f5d3aeb..1ad6e7b 100644 --- a/templates/machines/porter.jinja2 +++ b/templates/machines/porter.jinja2 @@ -1,6 +1,6 @@ {%- extends 'boot/generic-uboot-tftp.jinja2' %} {%- set device_type = "renesas-porter-uboot" %} {%- set dl_dir = "porter-nogfx" %} -{%- set dtb = "uImage-r8a7791-porter.dtb" %} -{%- set nbdinitrd = "initramfs-netboot-image-" + yocto_machine +".ext4.gz.u-boot" %} +{%- set dtb = dtb|default("uImage-r8a7791-porter.dtb") %} +{%- set initrd = initrd|default("initramfs-netboot-image-" + yocto_machine +".ext4.gz.u-boot") %} {%- set rootfs_type = rootfs_type|default("nbd") %} diff --git a/templates/machines/qemux86-64.jinja2 b/templates/machines/qemux86-64.jinja2 index 1c4d44d..a7aaa6d 100644 --- a/templates/machines/qemux86-64.jinja2 +++ b/templates/machines/qemux86-64.jinja2 @@ -2,6 +2,8 @@ {%- set deploy_to = "tmpfs" %} {%- set device_type = "qemu" %} {%- set kernel_image = "bzImage" %} +{%- set device_arch = "x86_64" %} +{%- set device_mach = "x86" %} {%- set qemu_arch = "x86_64" %} {%- set qemu_args = "-cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt -m 1048 -soundhw hda" %} {%- set qemu_cmdline = "console=ttyS0,115200 root=/dev/hda debug verbose" %} diff --git a/templates/machines/raspberrypi3.jinja2 b/templates/machines/raspberrypi3.jinja2 index f1e1454..2d96110 100644 --- a/templates/machines/raspberrypi3.jinja2 +++ b/templates/machines/raspberrypi3.jinja2 @@ -1,5 +1,12 @@ {%- extends 'boot/generic-uboot-tftp.jinja2' %} +{%- set device_arch = "arm64" %} +{%- set device_mach = "broadcom" %} {%- set device_type = "bcm2837-rpi-3-b" %} -{%- set dtb = "uImage-bcm2710-rpi-3-b.dtb" %} -{%- set nbdinitrd = "initramfs-netboot-image-" + yocto_machine +".ext4.gz.u-boot" %} +{# Default boot method if not specified #} {%- set rootfs_type = rootfs_type|default("nbd") %} +{# Defaults image names dependng on boot method #} +{%- if rootfs_type == 'nbd' %} + {%- set initrd = "initramfs-netboot-image-" + yocto_machine +".ext4.gz.u-boot" %} +{%- elif rootfs_type == 'ramdisk' %} + {%- set dtb = dtb|default("uImage-bcm2710-rpi-3-b.dtb") %} +{%- endif %}
\ No newline at end of file diff --git a/utils/agljobtemplate.py b/utils/agljobtemplate.py index c8edc8e..528a3b9 100644 --- a/utils/agljobtemplate.py +++ b/utils/agljobtemplate.py @@ -60,7 +60,8 @@ class Agljobtemplate(object): return self.RFS_TYPE def render_job(self, url, machine, job_name="AGL-short-smoke", priority="medium", tests=[], rfs_type=None, - kci_callback=None, rfs_image=None, build_version=None): + kci_callback=None, rfs_image=None, kernel_image=None, dtb_image=None, modules_image=None, + build_version=None): test_templates = [] if machine not in self.machines: @@ -89,6 +90,15 @@ class Agljobtemplate(object): if rfs_image is not None: job['rfs_image'] = rfs_image + if kernel_image is not None: + job['kernel_image'] = kernel_image + + if dtb_image is not None: + job['dtb'] = dtb_image + + if modules_image is not None: + job['modules'] = modules_image + if kci_callback: if test_templates: job['callback_name'] = 'lava/test' diff --git a/utils/create-jobs.py b/utils/create-jobs.py index 66e3b00..347c62b 100755 --- a/utils/create-jobs.py +++ b/utils/create-jobs.py @@ -32,18 +32,19 @@ def parse_cmdline(machines, tests, rfs_types): help='job id for link creation: URLBASE/JOB_ID') parser.add_argument('-i', '--jobidx', dest='job_index', action='store', help='job index for link creation: URLBASE/JOB_ID/JOB_INDEX', default='1') - parser.add_argument('--img-name', dest='img_name', action='store', - help="img base name (such as agl-demo-platform) - require img_ext") - parser.add_argument('--img-ext', dest='img_ext', action='store', - help="img extension (such as ext4.xz) - require img_name") + parser.add_argument('--rootfs-img', dest='rootfs_img', action='store', + help="The name of the root file system image (such as agl-demo-platform-raspberrypi3.ext4.xz)") + parser.add_argument('--kernel-img', dest='kernel_img', action='store', + help="The name of the kernel to boot (such as uImage)") + parser.add_argument('--dtb-img', dest='dtb_img', action='store', + help="The name of the dtb to use (such as uImage-bcm2710-rpi-3-b.dtb)") + parser.add_argument('--modules-img', dest='modules_img', action='store', + help="The name of the modules to use (such as modules.tar.xz)") parser.add_argument('--build-version', dest='build_version', action='store', help="the version number of the AGL build.") args = parser.parse_args() - if (not args.img_name) != (not args.img_ext): - parser.error("--img-name and --img-ext require one another") - return args @@ -53,9 +54,6 @@ def main(): ajt = agljobtemplate.Agljobtemplate(templates_dir) args = parse_cmdline(ajt.machines, ajt.tests, ajt.rfs_types) - if args.img_name: - img = args.img_name + "-" + args.machine + "." + args.img_ext - if args.tests is not None and 'all' in args.tests: args.tests = ajt.tests @@ -69,7 +67,11 @@ def main(): job = ajt.render_job(args.urlbase, args.machine, tests=args.tests, priority=args.priority, rfs_type=args.rfs_type, job_name=args.job_name, kci_callback=args.callback, - rfs_image=img, build_version=args.build_version) + rfs_image=args.rootfs_img, + kernel_image=args.kernel_img, + dtb_image=args.dtb_img, + modules_image=args.modules_img, + build_version=args.build_version) if args.job_file is None: print job |