1

On my embedded system, I use linux kernel 4.19.102 and systemd 240. Everything is generated using buildroot 2019.02.9.

I use the serial port of my device to output console.

bootargs = "console=ttyS0,115200";

With the previous version I used, everything were fine one the console side (buildroot 2018.05, kernel 4.16.y and systemd 237). I had the following file : /etc/systemd/system/getty.target.wants/[email protected] which was launching /sbin/getty -L ttyS0 115200 vt100

Now, the console prints the usual starting messages and then, prints the log message twice :

Welcome to MyDevice
MyDevice login:
Welcome to MyDevice
MyDevice login:

And when I try to log with a long password beginning with 'r', I get something like this :

Welcome to MyDevice
MyDevice login:
Welcome to MyDevice
MyDevice login: root
Password: r
Login incorrect
MyDevice login:

I can hopefully login with SSH. I have seen that the "getty" service is started twice in this version :

# ps | grep getty
  988 root     /sbin/getty -L ttyS0 115200 vt100
 1002 root     /sbin/getty -L console 115200 vt100
 1117 root     grep getty

The /etc file is now : /etc/systemd/system/getty.target.wants/console-getty.service which was launching /sbin/getty -L console 115200 vt100 But the /sbin/getty -L ttyS0 115200 vt100 is still started.

When I kill the 'console' service (to be in the same state as the previous version), I can login and the console is finally fine.

How Can I configure buildroot or systemd to prevent the console service to start ?

3
  • Ah, this is different to what would happen on a standard, full-fat systemd install. User JdeBP pointed out this code in buildroot as relevant. I have deleted my answer for now.
    – sourcejedi
    Commented Feb 11, 2020 at 20:24
  • Your buildroot link did just fine. The problem I had was that BR2_TARGET_GENERIC_GETTY_PORT was set on 'console' on buildroot 2018.05. It needs to be changed by 'ttyS0' in buildroot 2019.02.9. thks a lot
    – grorel
    Commented Feb 12, 2020 at 7:42
  • 2
    Great! All credit goes to JdeBP :-). Those two sentences would be enough for a short answer IMO. If you want to give thanks, could you post them as an answer, and click the grey tick next to it? (For the latter, the system will tell you to wait a day or so first). Then the system will show the question as answered (green), and other good stuff.
    – sourcejedi
    Commented Feb 12, 2020 at 9:00

1 Answer 1

3

The problem is that BR2_TARGET_GENERIC_GETTY_PORT was set on 'console' on buildroot 2018.05. It needs to be changed by 'ttyS0' in buildroot 2019.02.9.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .