summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2020-11-02 14:28:52 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-11-08 14:03:20 +0000
commit781d6a8316daa62627091375d5c7448cfe8b7a6d (patch)
tree82ad78b799f92628bc7ba2ff06182bd5ce82241f
parent017cdf751de357e122129168ddde85a61404909c (diff)
downloadpoky-781d6a8316daa62627091375d5c7448cfe8b7a6d.tar.gz
systemd-serialgetty: Switch to TERM=linux
Long ago in commit 473ff65c2f69de4ece3204fadfae7c5cb992149a (serial-getty service: Add xterm as default TERM), the xterm became the default for the serial port terminal. Using the version of vim.tiny in oe-core master with the serial port connected in xterm version 322 (which is one of the most widely deployed versions at the current time) causes artifacts and missed characters. The example sequence is the following: * Start vim * Press "i" to enter input mode * Type "123" * Press Escape to enter command mode * Press "a" to enter append mode * Type "456" At this point if you are using xterm less than version 535 you will see on your screen "12456" instead of "123456". Changing the TERM variable to "linux" will still allow you to have all the same functionality with colorization, ansi character escapes etc..., but will avoid the extra xterm specific escape sequence that only exists in the most recent versions of xterm. This patch allows the end user to set the serial terminal type to something other than the new default of "linux" by changing the SERIAL_TERM variable in local.conf. For example: SERIAL_TERM = "xterm" (From OE-Core rev: 3de72f45135d7c79b43ad25b539f117d040aa246) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty.bb2
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service2
2 files changed, 3 insertions, 1 deletions
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
index 0cc0dc8c79..d142b30f7e 100644
--- a/meta/recipes-core/systemd/systemd-serialgetty.bb
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=80
6PR = "r5" 6PR = "r5"
7 7
8SERIAL_CONSOLES ?= "115200;ttyS0" 8SERIAL_CONSOLES ?= "115200;ttyS0"
9SERIAL_TERM ?= "linux"
9 10
10SRC_URI = "file://serial-getty@.service" 11SRC_URI = "file://serial-getty@.service"
11 12
@@ -22,6 +23,7 @@ do_install() {
22 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ 23 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
23 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/ 24 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
24 sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ${D}${systemd_unitdir}/system/serial-getty@.service 25 sed -i -e "s/\@BAUDRATE\@/$default_baudrate/g" ${D}${systemd_unitdir}/system/serial-getty@.service
26 sed -i -e "s/\@TERM\@/${SERIAL_TERM}/g" ${D}${systemd_unitdir}/system/serial-getty@.service
25 27
26 tmp="${SERIAL_CONSOLES}" 28 tmp="${SERIAL_CONSOLES}"
27 for entry in $tmp ; do 29 for entry in $tmp ; do
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
index 549d566009..b16fe1188e 100644
--- a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
+++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -29,7 +29,7 @@ Conflicts=rescue.service
29Before=rescue.service 29Before=rescue.service
30 30
31[Service] 31[Service]
32Environment="TERM=xterm" 32Environment="TERM=@TERM@"
33ExecStart=-/sbin/agetty -8 -L %I @BAUDRATE@ $TERM 33ExecStart=-/sbin/agetty -8 -L %I @BAUDRATE@ $TERM
34Type=idle 34Type=idle
35Restart=always 35Restart=always