summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoys Ollivier <lollivier@baylibre.com>2017-10-06 11:10:54 +0200
committerLoys Ollivier <lollivier@baylibre.com>2017-10-09 10:18:49 +0200
commitd6c367c2847f300aab7feb1ac52c24f83ce6e304 (patch)
tree8b9a169ef0458d80c049ba4eb0c0d91a3fbd47d7
parent5bef8f20fbac8224d391ee3bea296f6e3b38c58d (diff)
New boot type definition
Depending on the boot type (ramdisk or nbd), specify a boot method. This change helps defining the correct boot type automatically from the boot protocol (ramdisk or nbd). Tested with m3ulcb (nbd) and raspberrypi3 (ramdisk). Change-Id: I84845c2fa94b32cd53c91a5330b25505e7b60930 Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
-rw-r--r--templates/base/agl-base-defaults.jinja210
-rw-r--r--templates/boot/generic-uboot-tftp.jinja213
2 files changed, 17 insertions, 6 deletions
diff --git a/templates/base/agl-base-defaults.jinja2 b/templates/base/agl-base-defaults.jinja2
index f426211..462fb86 100644
--- a/templates/base/agl-base-defaults.jinja2
+++ b/templates/base/agl-base-defaults.jinja2
@@ -19,6 +19,16 @@
{%- set vcs_branch = vcs_branch|default("agl-branch") %}
{%- set vcs_url = vcs_url|default(baseurl()) %}
+{# 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 initrd = initrd|default("initramfs-netboot-image-" + yocto_machine +".ext4.gz") %}
{%- set boot_commands = "nbd" %}
diff --git a/templates/boot/generic-uboot-tftp.jinja2 b/templates/boot/generic-uboot-tftp.jinja2
index 0f0f9e2..62c657e 100644
--- a/templates/boot/generic-uboot-tftp.jinja2
+++ b/templates/boot/generic-uboot-tftp.jinja2
@@ -10,9 +10,9 @@ protocols:
{% endblock %}
{%- block boot %}
{{ super() }}
- type: {{ uboot_type|default("bootm") }}
commands: {{ boot_commands|default("ramdisk") }}
{%- if rootfs_type == 'nbd' %}
+ type: {{ uboot_type|default("bootm") }}
transfer_overlay:
download_command: wget
unpack_command: tar -C / -xvpf
@@ -22,17 +22,18 @@ protocols:
{{ super() }}
kernel:
url: {{ kernel_url }}
-{%- if rootfs_type == 'nbd' %}
+{%- if rootfs_type == 'ramdisk' %}
+ type: {{ kernel_type }}
+ ramdisk:
+ url: {{ initrd_url }}
+ compression: {{ initrd_compression }}
+{%- elif rootfs_type == 'nbd' %}
initrd:
url: {{ initrd_url }}
allow_modify: false
nbdroot:
url: {{ rootfs_url }}
compression: {{ rootfs_compression }}
-{%- elif rootfs_type == 'ramdisk' %}
- ramdisk:
- url: {{ initrd_url }}
- compression: {{ initrd_compression }}
{%- endif %}
{%- if modules_url %}
modules: