[LEDE-DEV] [PATCH V1][RFC][procd] udevtrigger: trigger devices w/o dev sysfs entry

Sergiy Kibrik sakib at darkstar.site
Thu Mar 22 08:22:18 PDT 2018


A lot of devices aren't represented via major/minor numbers
and thus don't have dev entry in their sysfs directory, like
network devices, USB, power supplies etc.
It looks to be the rigth thing to trigger them as well.

Anyway, it's up to the hotplug daemon to decide what to do with devices,
it needs full vision of what's present in the system.

Signed-off-by: Sergiy Kibrik <sakib at darkstar.site>
---
 plug/udevtrigger.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plug/udevtrigger.c b/plug/udevtrigger.c
index f87a95e..d6c4c4c 100644
--- a/plug/udevtrigger.c
+++ b/plug/udevtrigger.c
@@ -161,9 +161,8 @@ static int device_list_insert(const char *path)
 
 	dbg("add '%s'" , path);
 
-	/* we only have a device, if we have a dev and an uevent file */
-	if (!device_has_attribute(path, "/dev", S_IRUSR) ||
-	    !device_has_attribute(path, "/uevent", S_IWUSR))
+	/* we only have a device, if we have an uevent file */
+	if (!device_has_attribute(path, "/uevent", S_IWUSR))
 		return -1;
 
 	strlcpy(devpath, &path[4], sizeof(devpath));
-- 
2.7.4




More information about the Lede-dev mailing list