Skip to contentSkip to conversation

New: Console (getty) issues with systemd

Buildroot bugzilla at busybox.net 2 participants 10 messages Apr 9, 2019 – Dec 10, 2019

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=11766

Bug ID: 11766
Summary: Console (getty) issues with systemd
Product: buildroot
Version: 2019.02.1
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: isak.tjernberg at gmail.com
CC: buildroot at uclibc.org
Target Milestone: ---

Created attachment 7976
--> https://bugs.busybox.net/attachment.cgi?id=7976&action=edit
Comparison between console-getty.service contents between 2018.11 and 2019.02.1

When using an image built with Buildroot for the Raspberry Pi 3 (64 bit) using systemd as init system, the serial console reached through 3 of the GPIO pins reports various errors and is generally unstable (misses characters sporadically). One common error I get printed is: "Inappropriate ioctl for device" from Getty.

This is on version 2019.02.1. The same config works fine with Buildroot 2018.11.

The error/issues goes away if I replace the contents in the file /etc/systemd/system/getty.target.wants/console-getty.service with the content in the same file from the image built with version 2018.11.

I can attach one file only, so the file contains the contents both from version 2018.11 (working) and 2019.02.1 (not working).

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

https://bugs.busybox.net/show_bug.cgi?id=11766

--- Comment #1 from khozaei <[email protected]> --- Created attachment 7986
--> https://bugs.busybox.net/attachment.cgi?id=7986&action=edit
getty options changed from -L to -h

I found the solution finally.

I added --flow-control option to agetty in serial-getty at .service and this option fixed my problem.

Quoted 5 lines

**-h, --flow-control**

Enable hardware (RTS/CTS) flow control. It is left up to the application to disable software (XON/XOFF) flow protocol where appropriate.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

khozaei <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

   Attachment #7986|getty options changed from  |getty options changed from
        description|-L to -h                    |-L to -h (fixed)
Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

Carlos Santos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

           Assignee|unassigned at buildroot.uclibc |unixmania at gmail.com
                   |.org                        |
             Status|NEW                         |ASSIGNED

--- Comment #2 from Carlos Santos <[email protected]> --- Hello,

The change you proposed does not seem to be required for other boards beyond Raspberry Pi 3. The best solution may be adding a post-buid script to patch serial-getty at .service. There is already a board/raspberrypi/post-build.sh.

Would you mind submitting a patch?

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

--- Comment #3 from Peter Seiderer <[email protected]> --- Enabling hardware flow control for a 3-wire serial line (without the extra wires for the hardware flow control) seems strange, and I believe is not the solution...

diff -u ~/Downloads/console-getty.service_comparison.txt ~/Downloads/console-getty.fixed.txt
--- /home/seiderer/Downloads/console-getty.service_comparison.txt

2019-04-09 19:02:33.570689557 +0200

+++ /home/seiderer/Downloads/console-getty.fixed.txt 2019-07-21
21:03:18.299974466 +0200
@@ -32,7 +32,7 @@
# The '-o' option value tells agetty to replace 'login' arguments with an # option to preserve environment (-p), followed by '--' for safety, and
then

     # the entered username.
-    ExecStart=-/sbin/getty -L %I 115200 vt100
+    ExecStart=-/sbin/getty -h %I 115200 vt100
     Type=idle
     Restart=always
     UtmpIdentifier=%I

You seem to have fixed the already working file (marked by you with 'console-getty.service from Buildroot 2018.11 (Working):' and not the one marked by your with 'console-getty.service from Buildroot 2019.02.1 (Not working):'.

The real diff between the two versions is:

- ExecStart=-/sbin/getty -L %I 115200 vt100
+ ExecStart=-/sbin/getty -L console 115200 vt100

Can you check which console/%I the working version is using on a running system?

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

--- Comment #4 from Peter Seiderer <[email protected]> ---
Tested with buildroot master and raspberrypi3_64_defconfig with the following changes:

- change to glibc
- channge to init systemd

No login on HDMI, double Buildroot login on serial.

After changing cmdline.txt from:

root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200

to (as described in [1]):

root=/dev/mmcblk0p2 rootwait console=ttyAMA0,115200 console=tty1

everything worked fine...

Login from serial, getty for HDMI console runs:

    /sbin/agetty -o -p -- \u --noclear --keep-baud console 115200,38

Login from HMDI conole, getty for serial runs:

    /sbin/agetty -o -p -- \u --keep-baud 115200,38400,9600 ttyS0 vt220

Mind to share your config/defconfig file?

[1] https://patchwork.ozlabs.org/patch/668134

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

Carlos Santos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |NEEDINFO
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Carlos Santos <[email protected]> --- Closing, since the reporter did not send the config file requested by Peter Seiderer in comment #4. Fee free to reopen, if you still believe that this bug is valid.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#7 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

Simon <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|NEEDINFO                    |---
             Status|RESOLVED                    |REOPENED

--- Comment #6 from Simon <[email protected]> --- I've ran into this issue as well when updating from 2018.11 to 2019.02.

The problem is that systemd automatically picks up the kernel's console=<console> parameter and creates a serial-console@<console>.service which collides with the one generated by buildroot.
The solution is to not create a service file for the serial console when using systemd.

See https://github.com/simonvanderveldt/norns-image/pull/40 for more info.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#8 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

Hello;

I also have run into this issue repeatedly with at least three boards:

RPI4
OrangePi PC Zero
NanoPI Neo-core2.

All with the exact same symptom as described above. If systemd is enabled, the user will get two Getty services.

My solution has been to disable the option " Run a Getty (login prompt) after boot"
under "System Configuration"

Adam

Quoted 28 lines · On Tue, Dec 10, 2019 at 12:02 PM <[email protected]> wrote:

https://bugs.busybox.net/show_bug.cgi?id=11766

Simon <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|NEEDINFO                    |---
             Status|RESOLVED                    |REOPENED

--- Comment #6 from Simon <[email protected]> --- I've ran into this issue as well when updating from 2018.11 to 2019.02.

The problem is that systemd automatically picks up the kernel's console=<console> parameter and creates a serial-console@<console>.service which collides with the one generated by buildroot.
The solution is to not create a service file for the serial console when using systemd.

See https://github.com/simonvanderveldt/norns-image/pull/40 for more info.

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#9 lore raw

[Buildroot] [Bug 11766] Console (getty) issues with systemd

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11766

Carlos Santos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |NEEDINFO
             Status|REOPENED                    |RESOLVED

--- Comment #7 from Carlos Santos <[email protected]> --- (In reply to Simon from comment #6)

This bug was open aiming a problem with the Raspberry Pi 3 board. Please don't reopen old bugs just because they are similar to your current problem.

If you are using systemd just don't select BR2_TARGET_GENERIC_GETTY and no serial-console@<console>.service will be created.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.