Fix #82: Revert parts of 34a1524 and add workaround from Void Linux

In commit 34a1524 the start of udevd was refactored to allow it to be a
properly monitored service caused systems using eudev to malfunction.

This patch reverts part of that commit and adds a workaround found when
trying to reproduce issue #82 on Void Linux:

   - Start a temporary udevd in the background
   - Call udevadm to trigger bringup of all subsystems and devices
   - Wait for everything to settle
   - Tell temporary udevd to exit (new)

In the world of `mdev` this song and dance act is not required.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-10-18 09:43:37 +02:00
parent dd8dd67106
commit 33916a2097
+13 -9
View File
@@ -350,7 +350,7 @@ int main(int argc, char* argv[])
run_interactive("mdev -s", "Populating device tree");
} else {
char *cmd;
char line[80];
char line[256];
cmd = which("udevd");
if (!cmd)
@@ -364,8 +364,19 @@ int main(int argc, char* argv[])
udev = 0;
}
free(cmd);
}
snprintf(line, sizeof(line), "%s --daemon", cmd);
run_interactive(line, "Populating device tree");
if (udev && whichp("udevadm")) {
run("udevadm trigger --action=add --type=subsystems");
run("udevadm trigger --action=add --type=devices");
run("udevadm settle --timeout=120");
run("udevadm control --exit");
}
free(cmd);
}
/*
@@ -419,13 +430,6 @@ int main(int argc, char* argv[])
sm_init(&sm);
sm_step(&sm);
/* On udev systems we can now talk to udevd */
if (udev && whichp("udevadm")) {
run("udevadm trigger --action=add --type=subsystems");
run("udevadm trigger --action=add --type=devices");
run("udevadm settle --timeout=120");
}
/*
* Network stuff
*/