diff options
author | Christian Breunig <christian@breunig.cc> | 2023-12-17 08:23:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 08:23:24 +0100 |
commit | f991faab2c0d95cbec5d46996b154145955572d7 (patch) | |
tree | 7b6157e73946826cdb4128cf5100ba627934136d /data/templates/grub/grub_vyos_version.j2 | |
parent | d5375ce02376a91c07ec68f8d410a08dcdc57ef9 (diff) | |
parent | 8809d2e799ae1130b3328b081466b7d772a3da23 (diff) | |
download | vyos-1x-f991faab2c0d95cbec5d46996b154145955572d7.tar.gz vyos-1x-f991faab2c0d95cbec5d46996b154145955572d7.zip |
Merge pull request #2648 from jestabro/sagitta-image-tools
image-tools: T4516: revise system image tools
Diffstat (limited to 'data/templates/grub/grub_vyos_version.j2')
-rw-r--r-- | data/templates/grub/grub_vyos_version.j2 | 22 |
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" +} |