base-grub
base template
This template is not a device-type: it holds the settings shared by the 17 device-types that extend it, directly or not.
Inheritance tree
base-grub 17 device-types
Device-types extending base-grub (17)
| Device type | Vendor | Arch | Through |
|---|---|---|---|
| aaeon-UPN-EHLX4RE-A10-0864 Aaeon UP squared with Intel X6425RE CPU |
Intel | x86_64 | directly |
| d2500cc | Intel | x86_64 | directly |
| i945gsex-qs | Intel | x86 | directly |
| lenovo-hr330a-7x33cto1ww-emag | Ampere / AppliedMicro | arm64 | directly |
| minnowboard-max-E3825 | Intel | x86_64 | minnowboard-common |
| minnowboard-turbot-E3826 | Intel | x86_64 | minnowboard-common |
| moonshot-m400 | Ampere / AppliedMicro | arm64 | directly |
| pc-k10n78 | AMD | x86_64 | directly |
| qcom-qdf2400 | Qualcomm | arm64 | directly |
| supermicro-as-2015hr-tnr | AMD | x86_64 | directly |
| synquacer | Socionext | arm64 | directly |
| synquacer-acpi | Socionext | arm64 | synquacer |
| synquacer-dtb | Socionext | arm64 | synquacer |
| tegra234-3737-0000+3701-0000 | NVIDIA | arm64 | directly |
| upsquare | Intel | x86_64 | directly |
| x86-pentium4 | Intel | x86 | directly |
| x86-x5-z8350 | Intel | x86_64 | directly |
{% extends 'base.jinja2' %}
{% set console_device = console_device | default('ttyS0') %}
{% set baud_rate = baud_rate | default(115200) %}
{% set grub_installed_device = grub_installed_device | default('(hd1,gpt1)') %}
{% set efi_grub = efi_grub | default(False) %}
{% set pxe_net_configured = pxe_net_configured | default(True) %}
{% set net_interface = net_interface | default('') %}
{# allow job context override - use a different variable name, undefined if not in job context #}
{% set base_kernel_args = extra_kernel_args | default(base_kernel_args) %}
{% if efi_grub %}
{% if net_commands is not defined %}
{% if static_ip %}
{% set net_commands = " - net_add_addr lava efinet0 " + static_ip + "
- net_add_route lava 0.0.0.0 gw " + static_gateway + "
- net_add_dns " + static_dns %}
{% else %}
{% if pxe_net_configured %}
{% set net_commands = " - net_ls_addr" %}
{% else %}
{% if net_interface %}
{% set net_commands = " - net_bootp " + net_interface %}
{% else %}
{% set net_commands = " - net_bootp" %}
{% endif %}
{% endif %}
{# end static_ip #}
{% endif %}
{% endif %}
{% if efinet %}
{% set net_commands = " - insmod efinet
" + net_commands %}
{% endif %}
{% else %}
{# not efi_grub #}
{% if net_commands is not defined %}
{% if net_interface %}
{% set net_commands = " - net_bootp " + net_interface %}
{% else %}
{% set net_commands = " - net_bootp" %}
{% endif %}
{% endif %}
{% endif %}
{% if console_device %}
{% set console_args = "console=" ~ console_device ~ "," ~ baud_rate %}
{% else %}
{% set console_args = "" %}
{% endif %}
{% if has_dtb %}
{% set dtb_commands = " - clear
- devicetree (tftp,{SERVER_IP})/{DTB}" %}
{% else %}
{% set dtb_commands = "" %}
{% endif %}
{% if has_nodebooter %}
{% set nodebooter_action = " nodebooter:" %}
{% else %}
{% set nodebooter_action = "" %}
{% endif %}
{% block body %}
actions:
deploy:
connections:
serial:
methods:
tftp:
nbd:
boot:
connections:
serial:
methods:
minimal:
{{ nodebooter_action }}
grub:
parameters:
bootloader_prompt: {{ bootloader_prompt|default('grub>') }}
needs_interrupt: {{ grub_needs_interrupt|default(true) }}
ramdisk:
commands:
{% block ramdisk_commands %}
{{ net_commands }}
- clear
- insmod linux
- clear
- insmod tftp
- clear
- 'linux (tftp,{SERVER_IP})/{KERNEL} {{ console_args }} {{ base_ip_args }} {{ base_kernel_args }}'
- clear
- initrd (tftp,{SERVER_IP})/{RAMDISK}
{{ dtb_commands }}
- clear
- boot
{% endblock ramdisk_commands %}
nbd:
commands:
- clear
- insmod linux
- clear
- insmod tftp
- clear
- 'linux (tftp,{SERVER_IP})/{KERNEL} {{ console_args }} {{ base_ip_args }} {{ base_nbdroot_args }} rw {{ base_kernel_args }}'
- clear
- initrd (tftp,{SERVER_IP})/{RAMDISK}
- boot
nfs:
commands:
{% block nfs_commands %}
{{ net_commands }}
- 'linux (tftp,{SERVER_IP})/{KERNEL} {{ console_args }} root=/dev/nfs rw {{ base_nfsroot_args }} {{ base_ip_args }} {{ base_kernel_args }}'
- initrd (tftp,{SERVER_IP})/{RAMDISK}
{{ dtb_commands }}
- boot
{% endblock nfs_commands %}
debian-installer:
expect_shell: False
commands:
{{ net_commands }}
- 'linux (tftp,{SERVER_IP})/{KERNEL} auto=true interface=eth0 priority=critical noshell BOOT_DEBUG=1 DEBIAN_FRONTEND=text url=tftp://{SERVER_IP}/{PRESEED_CONFIG} --- {{ console_args }} {{ base_kernel_args }} debug verbose'
- initrd (tftp,{SERVER_IP})/{RAMDISK}
{{ dtb_commands }}
- boot
debian-installed:
commands:
- insmod part_gpt
- insmod ext2
- insmod part_msdos
- insmod chain
- ls
- ls {{ grub_installed_device }}
- sleep 10
- set
- set root={{ grub_installed_device }}
- sleep 10
- ls {{ grub_installed_device }}
- sleep 10
- chainloader {{ grub_installed_device }}/efi/debian/grubaa64.efi
- sleep 10
- boot
test:
methods:
docker:
global_options:
- {{ docker_shell_global_arguments }}
options:
- {{ docker_shell_extra_arguments }}
{% endblock body %}