summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-24 21:05:47 +0100
committerGitHub <noreply@github.com>2026-02-24 21:05:47 +0100
commit1ebebdfadc9d9f5793f9f99bcadc72ac58bf70e9 (patch)
treeb423ffee7aeb797cbdadddf98c24850d32f07cb7
parent557e1730b03638d3ee5e7a270d1958c436c8d917 (diff)
parent33669098f2a63b4cd7d40aadb53d62a3d61c2e21 (diff)
downloadvyos-1x-1ebebdfadc9d9f5793f9f99bcadc72ac58bf70e9.tar.gz
vyos-1x-1ebebdfadc9d9f5793f9f99bcadc72ac58bf70e9.zip
Merge pull request #4915 from sever-sever/T8120
T8120: Add support AMA console for ARM devices
-rw-r--r--data/templates/grub/grub_common.j22
-rw-r--r--data/templates/grub/grub_compat.j24
-rw-r--r--data/templates/grub/grub_options.j27
-rw-r--r--data/templates/grub/grub_vyos_version.j22
-rw-r--r--interface-definitions/system_console.xml.in2
-rwxr-xr-xsrc/op_mode/image_installer.py2
-rwxr-xr-xsrc/op_mode/image_manager.py2
7 files changed, 14 insertions, 7 deletions
diff --git a/data/templates/grub/grub_common.j2 b/data/templates/grub/grub_common.j2
index 5e9b95cc0..86fdbdf60 100644
--- a/data/templates/grub/grub_common.j2
+++ b/data/templates/grub/grub_common.j2
@@ -7,7 +7,7 @@ fi
# create and activate serial console
function setup_serial {
# initialize the first serial port by default
- if [ "${console_type}" == "ttyS" ]; then
+ if [ "${console_type}" = "ttyS" -o "${console_type}" = "ttyAMA" ]; then
if [ "${console_num}" == "0" ]; then
serial --unit=0 --speed=${console_speed}
else
diff --git a/data/templates/grub/grub_compat.j2 b/data/templates/grub/grub_compat.j2
index 8fb4f71dc..7f930a11f 100644
--- a/data/templates/grub/grub_compat.j2
+++ b/data/templates/grub/grub_compat.j2
@@ -12,7 +12,7 @@
{% macro console_name(type) -%}
{% if type == 'tty' -%}
KVM
-{%- elif type == 'ttyS' -%}
+{%- elif type == 'ttyS' or type == 'ttyAMA' -%}
Serial
{%- else -%}
Unknown
@@ -23,6 +23,8 @@
console=ttyS0,{{ console_speed }} console=tty0
{%- elif type == 'ttyS' -%}
console=tty0 console=ttyS0,{{ console_speed }}
+{%- elif type == 'ttyAMA' -%}
+ console=tty0 console=ttyAMA0,{{ console_speed }}
{%- else -%}
console=tty0 console=ttyS0,{{ console_speed }}
{%- endif %}
diff --git a/data/templates/grub/grub_options.j2 b/data/templates/grub/grub_options.j2
index a00bf4e37..0f2f15caf 100644
--- a/data/templates/grub/grub_options.j2
+++ b/data/templates/grub/grub_options.j2
@@ -28,7 +28,12 @@ submenu "Boot options" {
configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg
}
menuentry "ttyS (serial)" {
- set console_type="ttyS"
+ if [ "${grub_cpu}" = "arm64" ]; then
+ set serial_console="ttyAMA"
+ else
+ set serial_console="ttyS"
+ fi
+ set console_type="$serial_console"
export console_type
setup_serial
configfile ${prefix}/grub.cfg.d/*vyos-menu*.cfg
diff --git a/data/templates/grub/grub_vyos_version.j2 b/data/templates/grub/grub_vyos_version.j2
index de85f1419..c546670c2 100644
--- a/data/templates/grub/grub_vyos_version.j2
+++ b/data/templates/grub/grub_vyos_version.j2
@@ -11,7 +11,7 @@
{% endif %}
menuentry "{{ version_name }}" --id {{ version_uuid }} {
set boot_opts="{{ boot_opts_rendered }}"
- if [ "${console_type}" == "ttyS" ]; then
+ if [ "${console_type}" == "ttyS" -o "${console_type}" == "ttyAMA" ]; then
set console_opts="console=${console_type}${console_num},${console_speed}"
else
set console_opts="console=${console_type}${console_num}"
diff --git a/interface-definitions/system_console.xml.in b/interface-definitions/system_console.xml.in
index 5acd3e90b..78df0a6af 100644
--- a/interface-definitions/system_console.xml.in
+++ b/interface-definitions/system_console.xml.in
@@ -28,7 +28,7 @@
<description>Xen console</description>
</valueHelp>
<constraint>
- <regex>(ttyS[0-9]+|hvc[0-9]+|usb[0-9]+b.*)</regex>
+ <regex>(ttyS[0-9]+|ttyAMA[0-9]+|hvc[0-9]+|usb[0-9]+b.*)</regex>
</constraint>
</properties>
<children>
diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py
index a924d188e..f0a347b73 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -761,7 +761,7 @@ def console_hint() -> str:
path = '/dev/tty'
name = Path(path).name
- if name == 'ttyS0':
+ if name in ['ttyS0', 'ttyAMA0']:
return 'S'
else:
return 'K'
diff --git a/src/op_mode/image_manager.py b/src/op_mode/image_manager.py
index 40668793e..985db96dd 100755
--- a/src/op_mode/image_manager.py
+++ b/src/op_mode/image_manager.py
@@ -33,7 +33,7 @@ DELETE_IMAGE_PROMPT_MSG: str = 'Select an image to delete:'
MSG_DELETE_IMAGE_RUNNING: str = 'Currently running image cannot be deleted; reboot into another image first'
MSG_DELETE_IMAGE_DEFAULT: str = 'Default image cannot be deleted; set another image as default first'
-ConsoleType: TypeAlias = Literal['tty', 'ttyS']
+ConsoleType: TypeAlias = Literal['tty', 'ttyS', 'ttyAMA']
def annotate_list(images_list: list[str]) -> list[str]:
"""Annotate list of images with additional info