diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-08-20 18:19:08 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-08-20 18:19:08 +0200 |
commit | 220dac4c5eb3d82b5473c7532eb731df184e11f7 (patch) | |
tree | d921b38364af324f5f481b31cc7bb07d88ae3610 | |
parent | 775f5e35871b665f9cf95698928377c49e3b13fa (diff) |
export DRIVER for older kernels as a replacement for PHYSDEVDRIVER
-rw-r--r-- | udevd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) { |