Skip to contentSkip to conversation

serial-getty service: Add linux as default TERM

PATCH Superseded Joel Fernandes 3 participants 8 messages May 3, 2014 – May 5, 2014

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 serial-getty service: Add linux as default TERM

In poky with systemd enabled, vt102 is selected for getty causing user to experience a very crappy terminal. Default TERM to linux.

---
v2: Dropped PR bump

 .../systemd-serialgetty/[email protected]      |    1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd-serialgetty/[email protected] +1 -0
index 865de34..eb2280b 100644
@@ -20,6 +20,7 @@ Before=getty.target
 IgnoreOnIsolate=yes
 
 [Service]
+Environment="TERM=linux"
 ExecStart=-/sbin/agetty --keep-baud %I @BAUDRATE@ $TERM
 Type=idle
 Restart=always
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 16 lines · Joel Fernandes

In poky with systemd enabled, vt102 is selected for getty causing user to experience a very crappy terminal. Default TERM to linux.

---
v2: Dropped PR bump

  .../systemd-serialgetty/[email protected]      |    1 +
  1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd-serialgetty/[email protected] +0 -0
index 865de34..eb2280b 100644

meta/recipes-core/systemd/systemd-serialgetty/[email protected] Before=getty.target · line 26

Quoted 7 lines
meta/recipes-core/systemd/systemd-serialgetty/[email protected] +1 -0
@@ -20,6 +20,7 @@ Before=getty.target
  IgnoreOnIsolate=yes
 
  [Service]
+Environment="TERM=linux"
  ExecStart=-/sbin/agetty --keep-baud %I @BAUDRATE@ $TERM
  Type=idle
  Restart=always

I would prefer:
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM

"xterm" as it is much more widely supported than "linux". Also, PuTTY uses "xterm" by default.
-8 to assume the tty is 8-bit clean and disable parity detection. I have had some issues where parity sometimes gets enabled even though the serial line is 8-bit clean and I end up with garbage on the serial terminal.

Regards,
Jonathan

#2 lore raw
Quoted 29 lines · Jonathan Liu
Quoted 18 lines · Joel Fernandes

In poky with systemd enabled, vt102 is selected for getty causing user to experience a very crappy terminal. Default TERM to linux.

---
v2: Dropped PR bump

  .../systemd-serialgetty/[email protected]      |    1 +
  1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/systemd/systemd-serialgetty/[email protected] b/meta/recipes-core/systemd/systemd-serialgetty/[email protected] index 865de34..eb2280b 100644

meta/recipes-core/systemd/systemd-serialgetty/[email protected] Before=getty.target · line 25

Quoted 6 lines
meta/recipes-core/systemd/systemd-serialgetty/[email protected] +1 -0
@@ -20,6 +20,7 @@ Before=getty.target
  IgnoreOnIsolate=yes
    [Service]
+Environment="TERM=linux"
  ExecStart=-/sbin/agetty --keep-baud %I @BAUDRATE@ $TERM
  Type=idle
  Restart=always

I would prefer:
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM

Quoted 6 lines

"xterm" as it is much more widely supported than "linux". Also, PuTTY uses "xterm" by default.
-8 to assume the tty is 8-bit clean and disable parity detection. I have had some issues where parity sometimes gets enabled even though the serial line is 8-bit clean and I end up with garbage on the serial terminal.

Fair enough, I tested and it works fine for me. Will submit a patch.

-Joel

#3 lore raw
In reply to Jonathan Liu
Quoted 3 lines · Jonathan Liu

I would prefer:
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM

I wonder if that would add some dependency on right terminfo being present on system ?

#4 lore raw
Quoted 8 lines · Khem Raj
Quoted 3 lines · Jonathan Liu

I would prefer:
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM

I wonder if that would add some dependency on right terminfo being present on system ?

I thought about this too, I have no idea frankly, I can see that it probably would :-(

#5 lore raw
Quoted 6 lines · Joel Fernandes
Quoted 5 lines · Khem Raj
Quoted 3 lines · Jonathan Liu

I would prefer:
Environment="TERM=xterm"
ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM

Quoted 7 lines
Quoted 3 lines

I wonder if that would add some dependency on right terminfo being present on system ?

I thought about this too, I have no idea frankly, I can see that it probably would :-(

Khem,
terminfo data (/usr/share/terminfo) seems to be coming from ncurses in my build. I think ncurses-terminfo-base. Not sure what the right dependency play we should be doing for this... set dependency to ncurses-terminfo-base?

by the way
/lib/systemd/system/debug-shell.service
which ships with systemd already sets Environment=TERM=linux

Thanks,
-Joel

#6 lore raw
Quoted 6 lines · Joel Fernandes

Khem,
terminfo data (/usr/share/terminfo) seems to be coming from ncurses in my build. I think ncurses-terminfo-base. Not sure what the right dependency play we should be doing for this... set dependency to ncurses-terminfo-base?

adding ncurses to dependencies would do it. but that could be an overkill.

Quoted 3 lines

by the way
/lib/systemd/system/debug-shell.service
which ships with systemd already sets Environment=TERM=linux

yes this seems ok probably.

#7 lore raw
Quoted 8 lines · Khem Raj
Quoted 6 lines · Joel Fernandes

Khem,
terminfo data (/usr/share/terminfo) seems to be coming from ncurses in my build. I think ncurses-terminfo-base. Not sure what the right dependency play we should be doing for this... set dependency to ncurses-terminfo-base?

Quoted 8 lines

adding ncurses to dependencies would do it. but that could be an overkill.

Quoted 3 lines

by the way
/lib/systemd/system/debug-shell.service
which ships with systemd already sets Environment=TERM=linux

yes this seems ok probably.

Ok. I'll take that as an Ack :-D. So can you pull this patch (or someone else)?

Regards,
-Joel