summaryrefslogtreecommitdiffstats
path: root/package/systemd
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2014-10-09 15:58:02 +0200
committerPeter Korsgaard <peter@korsgaard.com>2014-10-12 15:37:01 +0200
commitc95bf441a6e13d74a67bef95cc12ec5ae80ebbca (patch)
tree5fe8f11fd7c072e97d31af2e04de46e126a37aea /package/systemd
parent3c25f6e6c0a57daac4786dbdf2f0242273641566 (diff)
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>
Diffstat (limited to 'package/systemd')
-rw-r--r--package/systemd/systemd.mk16
1 files changed, 14 insertions, 2 deletions
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
index face84913..dafc65ce2 100644
--- a/package/systemd/systemd.mk
+++ b/package/systemd/systemd.mk
@@ -183,12 +183,24 @@ define SYSTEMD_USERS
systemd-network -1 systemd-network -1 * - - - Network Manager
endef
-define SYSTEMD_INSTALL_SERVICE_TTY
+define SYSTEMD_DISABLE_SERVICE_TTY1
rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
- ln -fs ../../../../lib/systemd/system/serial-getty@.service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
+endef
+
+# systemd needs getty.service for VTs and serial-getty.service for serial ttys
+define SYSTEMD_INSTALL_SERVICE_TTY
+ if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
+ then \
+ SERVICE="getty"; \
+ else \
+ SERVICE="serial-getty"; \
+ fi; \
+ ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
+ $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
endef
define SYSTEMD_INSTALL_INIT_SYSTEMD
+ $(SYSTEMD_DISABLE_SERVICE_TTY1)
$(SYSTEMD_INSTALL_SERVICE_TTY)
$(SYSTEMD_INSTALL_SERVICE_NETWORK)
$(SYSTEMD_INSTALL_SERVICE_TIMESYNC)