summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-20 18:19:08 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-20 18:19:08 +0200
commit220dac4c5eb3d82b5473c7532eb731df184e11f7 (patch)
treed921b38364af324f5f481b31cc7bb07d88ae3610
parent775f5e35871b665f9cf95698928377c49e3b13fa (diff)
export DRIVER for older kernels as a replacement for PHYSDEVDRIVER
-rw-r--r--udevd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/udevd.c b/udevd.c
index bec4e3d7b4..3da56ca294 100644
--- a/udevd.c
+++ b/udevd.c
@@ -566,6 +566,7 @@ static struct udevd_uevent_msg *get_msg_from_envbuf(const char *buf, int buf_siz
int bufpos;
int i;
struct udevd_uevent_msg *msg;
+ char *physdevdriver_key = NULL;
int major = 0;
int minor = 0;
@@ -600,6 +601,8 @@ static struct udevd_uevent_msg *get_msg_from_envbuf(const char *buf, int buf_siz
msg->seqnum = strtoull(&key[7], NULL, 10);
else if (strncmp(key, "PHYSDEVPATH=", 12) == 0)
msg->physdevpath = &key[12];
+ else if (strncmp(key, "PHYSDEVDRIVER=", 14) == 0)
+ physdevdriver_key = key;
else if (strncmp(key, "MAJOR=", 6) == 0)
major = strtoull(&key[6], NULL, 10);
else if (strncmp(key, "MINOR=", 6) == 0)
@@ -609,6 +612,13 @@ static struct udevd_uevent_msg *get_msg_from_envbuf(const char *buf, int buf_siz
}
msg->devt = makedev(major, minor);
msg->envp[i++] = "UDEVD_EVENT=1";
+
+ if (msg->driver == NULL && msg->physdevpath == NULL && physdevdriver_key != NULL) {
+ /* for older kernels DRIVER is empty for a bus device, export PHYSDEVDRIVER as DRIVER */
+ msg->envp[i++] = &physdevdriver_key[7];
+ msg->driver = &physdevdriver_key[14];
+ }
+
msg->envp[i] = NULL;
if (msg->devpath == NULL || msg->action == NULL) {