package/systemd: fix getty setup
authorAndré Erdmann <dywi@mailerd.de>
Thu, 9 Oct 2014 13:58:02 +0000 (15:58 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 12 Oct 2014 13:37:01 +0000 (15:37 +0200)
commitc95bf441a6e13d74a67bef95cc12ec5ae80ebbca
tree5fe8f11fd7c072e97d31af2e04de46e126a37aea
parent3c25f6e6c0a57daac4786dbdf2f0242273641566
package/systemd: fix getty setup

When trying to run a buildroot system configured with
BR2_TARGET_GENERIC_GETTY_PORT="tty1" (x86_64), the boot process hangs
with the following message:
  "A start job is running for dev-tty1.device (<time> / 1min 30s)"

Replacing /etc/systemd/system/getty.target.wants/serial-getty@tty1.service
(linking to serial-getty@) with getty@tty1.service (-> getty@) fixes the issue.

This patch adds a check that "detects" the tty type by removing digits at the
end of BR2_TARGET_GENERIC_GETTY_PORT and comparing the resulting base name.
An instance of getty@service gets created if the name matches "tty",
otherwise serial-getty@ gets instantiated (as before).

So, tty1,tty2,... are created as links getty@tty1.service -> getty@,
while ttyS0, ttyAMA0, ... are created as instances of serial-getty@.

[Peter: simplify logic]
Signed-off-by: André Erdmann <dywi@mailerd.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/systemd/systemd.mk