summaryrefslogtreecommitdiff
path: root/data/templates/grub/grub_vyos_version.j2
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-16 13:45:43 -0600
committerGitHub <noreply@github.com>2023-11-16 13:45:43 -0600
commitd4f9d6ce726ea4d4fff6eecc16678d7a45a0b555 (patch)
treebad8b2fbfd9e325d9e6338bb8abd6608a2537c04 /data/templates/grub/grub_vyos_version.j2
parentc8ba5dccfa9b02533c6536903ecacd3ddb04351e (diff)
parente036f783bc85e4d2bad5f5cbfd688a03a352223e (diff)
downloadvyos-1x-d4f9d6ce726ea4d4fff6eecc16678d7a45a0b555.tar.gz
vyos-1x-d4f9d6ce726ea4d4fff6eecc16678d7a45a0b555.zip
Merge pull request #1768 from zdc/T4516-sagitta
image: T4516: Added system image tools
Diffstat (limited to 'data/templates/grub/grub_vyos_version.j2')
-rw-r--r--data/templates/grub/grub_vyos_version.j222
1 files changed, 22 insertions, 0 deletions
diff --git a/data/templates/grub/grub_vyos_version.j2 b/data/templates/grub/grub_vyos_version.j2
new file mode 100644
index 000000000..97fbe8473
--- /dev/null
+++ b/data/templates/grub/grub_vyos_version.j2
@@ -0,0 +1,22 @@
+{% set boot_opts_default = "boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/" + version_name %}
+{% if boot_opts != '' %}
+{% set boot_opts_rendered = boot_opts %}
+{% else %}
+{% set boot_opts_rendered = boot_opts_default %}
+{% endif %}
+menuentry "{{ version_name }}" --id {{ version_uuid }} {
+ set boot_opts="{{ boot_opts_rendered }}"
+ # load rootfs to RAM
+ if [ "${boot_toram}" == "yes" ]; then
+ set boot_opts="${boot_opts} toram"
+ fi
+ if [ "${bootmode}" == "pw_reset" ]; then
+ set boot_opts="${boot_opts} console=${console_type}${console_num} init=/usr/libexec/vyos/system/standalone_root_pw_reset"
+ elif [ "${bootmode}" == "recovery" ]; then
+ set boot_opts="${boot_opts} console=${console_type}${console_num} init=/usr/bin/busybox init"
+ else
+ set boot_opts="${boot_opts} console=${console_type}${console_num}"
+ fi
+ linux "/boot/{{ version_name }}/vmlinuz" ${boot_opts}
+ initrd "/boot/{{ version_name }}/initrd.img"
+}