From 6885a9f8685c7627fcce5a262bad782c85e1ef0a Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 2 Oct 2016 23:02:17 +0200 Subject: [PATCH] Systems with udev/udevadm mess up /dev/console => silence console On systems with systemd-udev/udevadm the trigger addition of devices at boot wrecks havoc of /dev/console. This patch forces Finit to go silent by default on such systems. Far from ideal, but since the actual root cause for this messup is unknown this will have to do for now. Also, add a settle timeout of 120 sec to the udev device tree population. Signed-off-by: Joachim Nilsson --- finit.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/finit.c b/finit.c index 934d8549..ffa351ae 100644 --- a/finit.c +++ b/finit.c @@ -267,6 +267,13 @@ int main(int argc, char* argv[]) if (getpid() != 1) return client(argc, argv); + /* + * The trigger call to udevadm later on screws up the console + * XXX: Yes, this is an ugly workaround, please fix me. + */ + if (fexist("/sbin/udevadm")) + silent = 1; + /* * In case of emergency. */ @@ -352,8 +359,9 @@ int main(int argc, char* argv[]) run_interactive(devfsd, "Populating device tree"); if (fexist("/sbin/udevadm")) { - run_interactive("/sbin/udevadm trigger --action=add --type=subsystems", "Trigger subsystems"); - run_interactive("/sbin/udevadm trigger --action=add --type=devices", "Trigger devices"); + run("/sbin/udevadm trigger --action=add --type=subsystems"); + run("/sbin/udevadm trigger --action=add --type=devices"); + run("/sbin/udevadm settle --timeout=120"); } /*