diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 765666b..0000000 --- a/.cvsignore +++ /dev/null @@ -1,8 +0,0 @@ -udev-032.tar.bz2 -pam_console_setowner-1.3.tgz -pam_console_setowner-1.4.tgz -udev-034.tar.bz2 -udev-035.tar.bz2 -udev-036.tar.bz2 -udev-038.tar.gz -udev-039.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..287b708 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +udev-145.tar.bz2 diff --git a/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch b/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch new file mode 100644 index 0000000..dad08af --- /dev/null +++ b/0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch @@ -0,0 +1,38 @@ +From 7505831b7ee7b04d84424d2ed306a76abd32871c Mon Sep 17 00:00:00 2001 +From: David Zeuthen +Date: Tue, 10 Nov 2009 12:32:38 -0500 +Subject: [PATCH] cdrom_id: Still check profiles even if there is no media + +Even when there is no medium in the drive, we should still check the +profiles supported by the drive. Otherwise we fail to detect things +like Blu-ray drives. See + + https://bugzilla.gnome.org/show_bug.cgi?id=600273 + +for more information. + +Signed-off-by: David Zeuthen +--- + extras/cdrom_id/cdrom_id.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 6ea763b..2380b15 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -583,9 +583,9 @@ int main(int argc, char *argv[]) + goto exit; + } + +- /* check for media */ +- if (cd_media_compat(udev, fd) < 0) +- goto print; ++ /* check for media - don't bail if there's no media as we still need to ++ * to read profiles */ ++ cd_media_compat(udev, fd); + + /* check if drive talks MMC */ + if (cd_inquiry(udev, fd) < 0) +-- +1.6.5.2 + diff --git a/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch b/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch new file mode 100644 index 0000000..b5261ff --- /dev/null +++ b/0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch @@ -0,0 +1,117 @@ +From 1dc0ee343df6b6e2ce0591ff08a0aeae2aa2196f Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 27 Jul 2009 23:24:27 +0200 +Subject: [PATCH 1/5] enumeration: move ALSA control devices to the end of the enumerated devices of each card + +Generally ALSA control devices should be the last ones to be processed +for ACL changes and similar operations because they can then be used as +indicators that ACL management finished for all device nodes of a +specific card. + +This patch simple moves each controlC device behind all the pcmC devices +(and similar). +--- + libudev/libudev-enumerate.c | 59 ++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 56 insertions(+), 3 deletions(-) + +diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c +index db8c514..e372079 100644 +--- a/libudev/libudev-enumerate.c ++++ b/libudev/libudev-enumerate.c +@@ -187,7 +187,8 @@ static int syspath_cmp(const void *p1, const void *p2) + return ret; + } + +-static int devices_delay(struct udev *udev, const char *syspath) ++/* For devices that should be moved to the absolute end of the list */ ++static int devices_delay_end(struct udev *udev, const char *syspath) + { + static const char *delay_device_list[] = { + "/block/md", +@@ -207,6 +208,32 @@ static int devices_delay(struct udev *udev, const char *syspath) + return 0; + } + ++/* For devices that should just be moved a little bit later, just ++ * before the point where some common path prefix changes. Returns the ++ * number of characters that make up that common prefix */ ++static size_t devices_delay_later(struct udev *udev, const char *syspath) ++{ ++ const char *c; ++ ++ /* For sound cards the control device must be enumerated last ++ * to make sure it's the final device node that gets ACLs ++ * applied. Applications rely on this fact and use ACL changes ++ * on the control node as an indicator that the ACL change of ++ * the entire sound card completed. The kernel makes this ++ * guarantee when creating those devices, and hence we should ++ * too when enumerating them. */ ++ ++ if ((c = strstr(syspath, "/sound/card"))) { ++ c += 11; ++ c += strcspn(c, "/"); ++ ++ if (strncmp(c, "/controlC", 9) == 0) ++ return c - syspath + 1; ++ } ++ ++ return 0; ++} ++ + /** + * udev_enumerate_get_list_entry: + * @udev_enumerate: context +@@ -220,7 +247,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude + if (!udev_enumerate->devices_uptodate) { + unsigned int i; + unsigned int max; +- struct syspath *prev = NULL; ++ struct syspath *prev = NULL, *move_later = NULL; ++ size_t move_later_prefix; + + udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list); + qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp); +@@ -237,14 +265,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude + prev = entry; + + /* skip to be delayed devices, and add them to the end of the list */ +- if (devices_delay(udev_enumerate->udev, entry->syspath)) { ++ if (devices_delay_end(udev_enumerate->udev, entry->syspath)) { + syspath_add(udev_enumerate, entry->syspath); + continue; + } + ++ /* skip to be delayed devices, and move the to ++ * the point where the prefix changes. We can ++ * only move one item at a time. */ ++ if (!move_later) { ++ move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath); ++ ++ if (move_later_prefix > 0) { ++ move_later = entry; ++ continue; ++ } ++ } ++ ++ if (move_later && ++ strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) { ++ ++ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, ++ move_later->syspath, NULL, 0, 0); ++ move_later = NULL; ++ } ++ + udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, + entry->syspath, NULL, 0, 0); + } ++ ++ if (move_later) ++ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list, ++ move_later->syspath, NULL, 0, 0); ++ + /* add and cleanup delayed devices from end of list */ + for (i = max; i < udev_enumerate->devices_cur; i++) { + struct syspath *entry = &udev_enumerate->devices[i]; +-- +1.6.4.4 + diff --git a/0002-udevd-add-timestamp-to-debug-output.patch b/0002-udevd-add-timestamp-to-debug-output.patch new file mode 100644 index 0000000..4deaff6 --- /dev/null +++ b/0002-udevd-add-timestamp-to-debug-output.patch @@ -0,0 +1,72 @@ +From 4db7e84ad817944c624256b310d44bd888121c8e Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Fri, 17 Jul 2009 13:24:37 +0200 +Subject: [PATCH 2/5] udevd: add timestamp to --debug output + +--- + libudev/libudev-util-private.c | 3 ++- + udev/udevd.c | 13 +++++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c +index 5f5f4c1..f7daa94 100644 +--- a/libudev/libudev-util-private.c ++++ b/libudev/libudev-util-private.c +@@ -249,6 +249,8 @@ int util_run_program(struct udev *udev, const char *command, char **envp, + int i; + int err = 0; + ++ info(udev, "'%s' started\n", command); ++ + /* build argv from command */ + util_strscpy(arg, sizeof(arg), command); + i = 0; +@@ -273,7 +275,6 @@ int util_run_program(struct udev *udev, const char *command, char **envp, + argv[0] = arg; + argv[1] = NULL; + } +- info(udev, "'%s'\n", command); + + /* prepare pipes from child to parent */ + if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) { +diff --git a/udev/udevd.c b/udev/udevd.c +index 2cdc18b..69d509c 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -53,8 +54,15 @@ static void log_fn(struct udev *udev, int priority, + const char *format, va_list args) + { + if (debug) { +- fprintf(stderr, "[%d] %s: ", (int) getpid(), fn); +- vfprintf(stderr, format, args); ++ char buf[1024]; ++ struct timeval tv; ++ struct timezone tz; ++ ++ vsnprintf(buf, sizeof(buf), format, args); ++ gettimeofday(&tv, &tz); ++ fprintf(stderr, "%llu.%06u [%u] %s: %s", ++ (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec, ++ (int) getpid(), fn, buf); + } else { + vsyslog(priority, format, args); + } +@@ -266,6 +274,7 @@ static void worker_new(struct event *event) + struct worker_message msg; + int err; + ++ info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev)); + udev_event = udev_event_new(dev); + if (udev_event == NULL) + _exit(3); +-- +1.6.4.4 + diff --git a/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch b/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch new file mode 100644 index 0000000..c7bbca8 --- /dev/null +++ b/0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch @@ -0,0 +1,49 @@ +From 7766066b221302d75002cd5d5a021281388ee56c Mon Sep 17 00:00:00 2001 +From: Andrew Church +Date: Thu, 24 Sep 2009 10:51:12 -0700 +Subject: [PATCH 3/5] fix wrong parameter size on ioctl FIONREAD + +On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott wrote: +> It is about ioctl failures on amd64: +> http://bugs.gentoo.org/show_bug.cgi?id=286041 +> +> A bad parameter type to an ioctl() call causes udev-146 to generate "error +> getting buffer for inotify" messages in syslog. The offending code is +> roughly: +> +> ssize_t nbytes, pos; +> // ... +> ioctl(fd, FIONREAD, &nbytes); +> +> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least +> through gentoo-sources-2.6.31) uses type int: +> +> p = (void __user *) arg; +> switch (cmd) { +> case FIONREAD: +> // ... +> ret = put_user(send_len, (int __user *) p); +> +> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent +> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has +> a LOT of memory). +--- + udev/udevd.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/udev/udevd.c b/udev/udevd.c +index 69d509c..511cb4b 100644 +--- a/udev/udevd.c ++++ b/udev/udevd.c +@@ -656,7 +656,7 @@ static void handle_ctrl_msg(struct udev_ctrl *uctrl) + /* read inotify messages */ + static int handle_inotify(struct udev *udev) + { +- ssize_t nbytes, pos; ++ int nbytes, pos; + char *buf; + struct inotify_event *ev; + +-- +1.6.4.4 + diff --git a/0004-fix-single-session-CD-detection.patch b/0004-fix-single-session-CD-detection.patch new file mode 100644 index 0000000..6c933a6 --- /dev/null +++ b/0004-fix-single-session-CD-detection.patch @@ -0,0 +1,38 @@ +From 36b35c884fc06bc2babf0ec840cb423b94a45f93 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 20 Sep 2009 19:07:51 +0200 +Subject: [PATCH 4/5] fix single-session CD detection + +ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single +session (i. e. for the vast majority of CDs out there). The previous rules ran +blkid with invalid arguments for these, causing CD detection to fail in +DK-disks and gvfs. + +Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if +not, call blkid without -O for specifying the offset. + +Many thanks to Maxim Levitsky for tracking this down! + +https://launchpad.net/bugs/431055 +--- + rules/rules.d/60-persistent-storage.rules | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 64e9578..1b85156 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -61,7 +61,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA + ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" + + # probe filesystem metadata of optical drives which have a media inserted +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +-- +1.6.4.4 + diff --git a/0005-fix-previous-commit-for-CD-detection.patch b/0005-fix-previous-commit-for-CD-detection.patch new file mode 100644 index 0000000..4b4eee4 --- /dev/null +++ b/0005-fix-previous-commit-for-CD-detection.patch @@ -0,0 +1,26 @@ +From a09ac6a6ae39512fafe9df331a311113d2a1d9f6 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Sun, 20 Sep 2009 19:21:04 +0200 +Subject: [PATCH 5/5] fix previous commit for CD detection + +Do not run blkid twice. *brown paperbag* +--- + rules/rules.d/60-persistent-storage.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules +index 1b85156..0950847 100644 +--- a/rules/rules.d/60-persistent-storage.rules ++++ b/rules/rules.d/60-persistent-storage.rules +@@ -63,7 +63,7 @@ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_ + # probe filesystem metadata of optical drives which have a media inserted + KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" + # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +-- +1.6.4.4 + diff --git a/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch new file mode 100644 index 0000000..0d34327 --- /dev/null +++ b/0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch @@ -0,0 +1,58 @@ +From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 18 Mar 2010 11:14:32 +0100 +Subject: [PATCH 35/65] cdrom_id: open non-mounted optical media with O_EXCL + +This should prevent confusing drives during CD burning sessions. Based +on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 26 +++++++++++++++++++++++++- + 1 files changed, 25 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 2380b15..e485768 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset; + #define ASC(errcode) (((errcode) >> 8) & 0xFF) + #define ASCQ(errcode) ((errcode) & 0xFF) + ++static int is_mounted(const char *device) ++{ ++ struct stat statbuf; ++ FILE *fp; ++ int maj, min; ++ int mounted = 0; ++ ++ if (stat(device, &statbuf) < 0) ++ return -ENODEV; ++ ++ fp = fopen("/proc/self/mountinfo", "r"); ++ if (fp == NULL) ++ return -ENOSYS; ++ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { ++ printf("got %u %u\n", maj, min); ++ if (makedev(maj, min) == statbuf.st_rdev) { ++ mounted = 1; ++ break; ++ } ++ } ++ fclose(fp); ++ return mounted; ++} ++ + static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err) + { + if (err == -1) { +@@ -568,7 +592,7 @@ int main(int argc, char *argv[]) + goto exit; + } + +- fd = open(node, O_RDONLY | O_NONBLOCK); ++ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); + fprintf(stderr, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0048-cdrom_id-remove-debugging-code.patch b/0048-cdrom_id-remove-debugging-code.patch new file mode 100644 index 0000000..57a4e07 --- /dev/null +++ b/0048-cdrom_id-remove-debugging-code.patch @@ -0,0 +1,24 @@ +From 36a07a8c34a4cff5ad2bbb6e0fdfed49e8191661 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 7 Apr 2010 09:23:46 +0200 +Subject: [PATCH 48/65] cdrom_id: remove debugging code + +--- + extras/cdrom_id/cdrom_id.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index e485768..036ef28 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -126,7 +126,6 @@ static int is_mounted(const char *device) + if (fp == NULL) + return -ENOSYS; + while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { +- printf("got %u %u\n", maj, min); + if (makedev(maj, min) == statbuf.st_rdev) { + mounted = 1; + break; +-- +1.6.6 + diff --git a/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch b/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch new file mode 100644 index 0000000..f7e6b27 --- /dev/null +++ b/0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch @@ -0,0 +1,53 @@ +From cccfffbe04c01be12fb42cb12f3f7aa5e2a22dd4 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 7 Apr 2010 09:24:25 +0200 +Subject: [PATCH 49/65] cdrom_id: retry to open the device, if EBUSY + +We might fight about the device with polling processes, or other +users who probe the device. Retry a few times if the other one goes +away in the meantime. + +Based on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 18 +++++++++++++++++- + 1 files changed, 17 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 036ef28..7c9f8cc 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -591,7 +592,22 @@ int main(int argc, char *argv[]) + goto exit; + } + +- fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); ++ if (is_mounted(node)) { ++ fd = open(node, O_RDONLY|O_NONBLOCK); ++ } else { ++ int cnt; ++ struct timespec duration; ++ ++ srand((unsigned int)getpid()); ++ for (cnt = 40; cnt > 0; cnt--) { ++ fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); ++ if (fd >= 0 || errno != EBUSY) ++ break; ++ duration.tv_sec = 0; ++ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); ++ nanosleep(&duration, NULL); ++ } ++ } + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); + fprintf(stderr, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0050-cdrom_id-check-mount-state-in-retry-loop.patch b/0050-cdrom_id-check-mount-state-in-retry-loop.patch new file mode 100644 index 0000000..b4fb62b --- /dev/null +++ b/0050-cdrom_id-check-mount-state-in-retry-loop.patch @@ -0,0 +1,55 @@ +From d45c8c8b01c99180f15e24b22f7cf81eaf3cdd1b Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 7 Apr 2010 11:32:22 +0200 +Subject: [PATCH 50/65] cdrom_id: check mount state in retry loop + +Based on a patch from Harald Hoyer. +--- + extras/cdrom_id/cdrom_id.c | 22 +++++++++------------- + 1 files changed, 9 insertions(+), 13 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 7c9f8cc..894a890 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -547,6 +547,7 @@ int main(int argc, char *argv[]) + const char *node = NULL; + int export = 0; + int fd = -1; ++ int cnt; + int rc = 0; + + udev = udev_new(); +@@ -592,21 +593,16 @@ int main(int argc, char *argv[]) + goto exit; + } + +- if (is_mounted(node)) { +- fd = open(node, O_RDONLY|O_NONBLOCK); +- } else { +- int cnt; ++ srand((unsigned int)getpid()); ++ for (cnt = 20; cnt > 0; cnt--) { + struct timespec duration; + +- srand((unsigned int)getpid()); +- for (cnt = 40; cnt > 0; cnt--) { +- fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL); +- if (fd >= 0 || errno != EBUSY) +- break; +- duration.tv_sec = 0; +- duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); +- nanosleep(&duration, NULL); +- } ++ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); ++ if (fd >= 0 || errno != EBUSY) ++ break; ++ duration.tv_sec = 0; ++ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000); ++ nanosleep(&duration, NULL); + } + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); +-- +1.6.6 + diff --git a/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch b/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch new file mode 100644 index 0000000..4b8520a --- /dev/null +++ b/0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch @@ -0,0 +1,18 @@ +diff -up udev-145/extras/cdrom_id/60-cdrom_id.rules.git51 udev-145/extras/cdrom_id/60-cdrom_id.rules +--- udev-145/extras/cdrom_id/60-cdrom_id.rules.git51 2009-04-17 00:27:40.000000000 +0200 ++++ udev-145/extras/cdrom_id/60-cdrom_id.rules 2010-04-13 18:25:47.000000000 +0200 +@@ -1,5 +1,12 @@ + # do not edit this file, it will be overwritten on update + + # import optical drive properties +-ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \ +- KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]|xvd*", IMPORT{program}="cdrom_id --export $tempnode" ++ACTION!="add|change", GOTO="cdrom_end" ++SUBSYSTEM!="block", GOTO="cdrom_end" ++KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" ++ENV{DEVTYPE}!="disk", GOTO="cdrom_end" ++ ++ENV{ID_CDROM}="1" ++IMPORT{program}="cdrom_id --export $tempnode" ++ ++LABEL="cdrom_end" diff --git a/0062-cdrom_id-Fix-uninitialized-variables.patch b/0062-cdrom_id-Fix-uninitialized-variables.patch new file mode 100644 index 0000000..b53056a --- /dev/null +++ b/0062-cdrom_id-Fix-uninitialized-variables.patch @@ -0,0 +1,131 @@ +From 816e6bf0fb0849d03696a4b4ec2334e35e819425 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 13 Apr 2010 10:49:24 +0200 +Subject: [PATCH 062/110] cdrom_id: Fix uninitialized variables + +In cases where cdrom_id does not go through the entire code path and one of the +probing functions returns -1 or exits early, the remaining variables were never +initialized. This caused effects like "phantom" audio CDs on empty drives, or +bogus data like ID_CDROM_MEDIA_TRACK_COUNT=22528. + +Initialize the variables right away to avoid that. + +Bug-Ubuntu: https://launchpad.net/bugs/559723 +--- + extras/cdrom_id/cdrom_id.c | 96 ++++++++++++++++++++++---------------------- + 1 files changed, 48 insertions(+), 48 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 894a890..db3867c 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -56,57 +56,57 @@ static void log_fn(struct udev *udev, int priority, + } + + /* device info */ +-static unsigned int cd_cd_rom; +-static unsigned int cd_cd_r; +-static unsigned int cd_cd_rw; +-static unsigned int cd_dvd_rom; +-static unsigned int cd_dvd_r; +-static unsigned int cd_dvd_rw; +-static unsigned int cd_dvd_ram; +-static unsigned int cd_dvd_plus_r; +-static unsigned int cd_dvd_plus_rw; +-static unsigned int cd_dvd_plus_r_dl; +-static unsigned int cd_dvd_plus_rw_dl; +-static unsigned int cd_bd; +-static unsigned int cd_bd_r; +-static unsigned int cd_bd_re; +-static unsigned int cd_hddvd; +-static unsigned int cd_hddvd_r; +-static unsigned int cd_hddvd_rw; +-static unsigned int cd_mo; +-static unsigned int cd_mrw; +-static unsigned int cd_mrw_w; ++static unsigned int cd_cd_rom = 0; ++static unsigned int cd_cd_r = 0; ++static unsigned int cd_cd_rw = 0; ++static unsigned int cd_dvd_rom = 0; ++static unsigned int cd_dvd_r = 0; ++static unsigned int cd_dvd_rw = 0; ++static unsigned int cd_dvd_ram = 0; ++static unsigned int cd_dvd_plus_r = 0; ++static unsigned int cd_dvd_plus_rw = 0; ++static unsigned int cd_dvd_plus_r_dl = 0; ++static unsigned int cd_dvd_plus_rw_dl = 0; ++static unsigned int cd_bd = 0; ++static unsigned int cd_bd_r = 0; ++static unsigned int cd_bd_re = 0; ++static unsigned int cd_hddvd = 0; ++static unsigned int cd_hddvd_r = 0; ++static unsigned int cd_hddvd_rw = 0; ++static unsigned int cd_mo = 0; ++static unsigned int cd_mrw = 0; ++static unsigned int cd_mrw_w = 0; + + /* media info */ +-static unsigned int cd_media; +-static unsigned int cd_media_cd_rom; +-static unsigned int cd_media_cd_r; +-static unsigned int cd_media_cd_rw; +-static unsigned int cd_media_dvd_rom; +-static unsigned int cd_media_dvd_r; +-static unsigned int cd_media_dvd_rw; +-static unsigned int cd_media_dvd_ram; +-static unsigned int cd_media_dvd_plus_r; +-static unsigned int cd_media_dvd_plus_rw; +-static unsigned int cd_media_dvd_plus_r_dl; +-static unsigned int cd_media_dvd_plus_rw_dl; +-static unsigned int cd_media_bd; +-static unsigned int cd_media_bd_r; +-static unsigned int cd_media_bd_re; +-static unsigned int cd_media_hddvd; +-static unsigned int cd_media_hddvd_r; +-static unsigned int cd_media_hddvd_rw; +-static unsigned int cd_media_mo; +-static unsigned int cd_media_mrw; +-static unsigned int cd_media_mrw_w; +- +-static const char *cd_media_state; +-static unsigned int cd_media_session_next; +-static unsigned int cd_media_session_count; +-static unsigned int cd_media_track_count; +-static unsigned int cd_media_track_count_data; +-static unsigned int cd_media_track_count_audio; +-static unsigned long long int cd_media_session_last_offset; ++static unsigned int cd_media = 0; ++static unsigned int cd_media_cd_rom = 0; ++static unsigned int cd_media_cd_r = 0; ++static unsigned int cd_media_cd_rw = 0; ++static unsigned int cd_media_dvd_rom = 0; ++static unsigned int cd_media_dvd_r = 0; ++static unsigned int cd_media_dvd_rw = 0; ++static unsigned int cd_media_dvd_ram = 0; ++static unsigned int cd_media_dvd_plus_r = 0; ++static unsigned int cd_media_dvd_plus_rw = 0; ++static unsigned int cd_media_dvd_plus_r_dl = 0; ++static unsigned int cd_media_dvd_plus_rw_dl = 0; ++static unsigned int cd_media_bd = 0; ++static unsigned int cd_media_bd_r = 0; ++static unsigned int cd_media_bd_re = 0; ++static unsigned int cd_media_hddvd = 0; ++static unsigned int cd_media_hddvd_r = 0; ++static unsigned int cd_media_hddvd_rw = 0; ++static unsigned int cd_media_mo = 0; ++static unsigned int cd_media_mrw = 0; ++static unsigned int cd_media_mrw_w = 0; ++ ++static const char *cd_media_state = NULL; ++static unsigned int cd_media_session_next = 0; ++static unsigned int cd_media_session_count = 0; ++static unsigned int cd_media_track_count = 0; ++static unsigned int cd_media_track_count_data = 0; ++static unsigned int cd_media_track_count_audio = 0; ++static unsigned long long int cd_media_session_last_offset = 0; + + #define ERRCODE(s) ((((s)[2] & 0x0F) << 16) | ((s)[12] << 8) | ((s)[13])) + #define SK(errcode) (((errcode) >> 16) & 0xF) +-- +1.7.0.1 + diff --git a/0065-cdrom_id-Fix-uninitialized-buffers.patch b/0065-cdrom_id-Fix-uninitialized-buffers.patch new file mode 100644 index 0000000..e0f3eb2 --- /dev/null +++ b/0065-cdrom_id-Fix-uninitialized-buffers.patch @@ -0,0 +1,82 @@ +From 2b861dc92757b9a3214c2b8e9d8b1c3f3c162391 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Tue, 13 Apr 2010 15:25:48 +0200 +Subject: [PATCH 065/110] cdrom_id: Fix uninitialized buffers + +Commit 5c6954f is actually a no-op, since static variables are already zero'ed +by default anyway (but we keep it for clarity). The real difference was that a +build with -O0 wor while a build with -O2 didn't. + +Turns out that some ioctls do not actually touch the result buffer in some +cases, so we need to zero the result buffers to avoid interpreting random da as +CD properties. + +https://launchpad.net/bugs/559723 +https://launchpad.net/bugs/561585 +--- + extras/cdrom_id/cdrom_id.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index db3867c..b6797cd 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -237,6 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) { + unsigned char inq[128]; + int err; + ++ memset (inq, 0, sizeof (inq)); + scsi_cmd_set(udev, &sc, 0, 0x12); + scsi_cmd_set(udev, &sc, 4, 36); + scsi_cmd_set(udev, &sc, 5, 0); +@@ -265,6 +266,7 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int i; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 0); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -282,6 +284,7 @@ static int cd_profiles(struct udev *udev, int fd) + return -1; + } + ++ memset (profiles, 0, sizeof (profiles)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 1); + scsi_cmd_set(udev, &sc, 6, len >> 16); +@@ -440,6 +443,7 @@ static int cd_media_info(struct udev *udev, int fd) + }; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x51); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); +@@ -472,6 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd) + unsigned char *p; + int err; + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, 1); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -493,6 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd) + if (len < 8) + return 0; + ++ memset (toc, 0, sizeof (toc)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ + scsi_cmd_set(udev, &sc, 7, len >> 8); +@@ -520,6 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd) + cd_media_track_count_audio++; + } + ++ memset (header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ + scsi_cmd_set(udev, &sc, 8, 12); +-- +1.7.0.1 + diff --git a/0066-cdrom_id.patch b/0066-cdrom_id.patch new file mode 100644 index 0000000..2ff817c --- /dev/null +++ b/0066-cdrom_id.patch @@ -0,0 +1,88 @@ +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index b6797cd..afb481d 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -1,7 +1,7 @@ + /* + * cdrom_id - optical drive and media information prober + * +- * Copyright (C) 2008 Kay Sievers ++ * Copyright (C) 2008-2010 Kay Sievers + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +@@ -157,7 +157,7 @@ struct scsi_cmd { + static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, int arg) + { + if (i == 0) { +- memset(cmd, 0x00, sizeof(struct scsi_cmd)); ++ memset(cmd, 0, sizeof(struct scsi_cmd)); + cmd->cgc.quiet = 1; + cmd->cgc.sense = &cmd->_sense.s; + memset(&cmd->sg_io, 0, sizeof(cmd->sg_io)); +@@ -237,7 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) { + unsigned char inq[128]; + int err; + +- memset (inq, 0, sizeof (inq)); ++ memset(inq, 0, sizeof(inq)); + scsi_cmd_set(udev, &sc, 0, 0x12); + scsi_cmd_set(udev, &sc, 4, 36); + scsi_cmd_set(udev, &sc, 5, 0); +@@ -266,7 +266,7 @@ static int cd_profiles(struct udev *udev, int fd) + unsigned int i; + int err; + +- memset (header, 0, sizeof (header)); ++ memset(header, 0, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 0); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -284,7 +284,7 @@ static int cd_profiles(struct udev *udev, int fd) + return -1; + } + +- memset (profiles, 0, sizeof (profiles)); ++ memset(profiles, 0, sizeof(profiles)); + scsi_cmd_set(udev, &sc, 0, 0x46); + scsi_cmd_set(udev, &sc, 1, 1); + scsi_cmd_set(udev, &sc, 6, len >> 16); +@@ -443,7 +443,7 @@ static int cd_media_info(struct udev *udev, int fd) + }; + int err; + +- memset (header, 0, sizeof (header)); ++ memset(header, 0, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x51); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); +@@ -476,7 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd) + unsigned char *p; + int err; + +- memset (header, 0, sizeof (header)); ++ memset(header, 0, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, 1); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -498,7 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd) + if (len < 8) + return 0; + +- memset (toc, 0, sizeof (toc)); ++ memset(toc, 0, sizeof(toc)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ + scsi_cmd_set(udev, &sc, 7, len >> 8); +@@ -526,7 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd) + cd_media_track_count_audio++; + } + +- memset (header, 0, sizeof (header)); ++ memset(header, 0, sizeof (header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ + scsi_cmd_set(udev, &sc, 8, 12); +-- +1.7.0.1 + diff --git a/0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch b/0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch new file mode 100644 index 0000000..8f96622 --- /dev/null +++ b/0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch @@ -0,0 +1,277 @@ +From 0413a47ebfcd46ae43cb56ad508b2484bc97ff14 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 15 Apr 2010 20:07:07 +0200 +Subject: [PATCH 067/110] cdrom_id: rework feature/profiles buffer parsing + +--- + extras/cdrom_id/cdrom_id.c | 156 +++++++++++++++++++++++++------------------ + 1 files changed, 91 insertions(+), 65 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index afb481d..3f9ca4c 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -154,19 +154,22 @@ struct scsi_cmd { + struct sg_io_hdr sg_io; + }; + +-static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, int arg) ++static void scsi_cmd_init(struct udev *udev, struct scsi_cmd *cmd, unsigned char *buf, size_t bufsize) ++{ ++ memset(cmd, 0x00, sizeof(struct scsi_cmd)); ++ memset(buf, 0x00, bufsize); ++ cmd->cgc.quiet = 1; ++ cmd->cgc.sense = &cmd->_sense.s; ++ memset(&cmd->sg_io, 0, sizeof(cmd->sg_io)); ++ cmd->sg_io.interface_id = 'S'; ++ cmd->sg_io.mx_sb_len = sizeof(cmd->_sense); ++ cmd->sg_io.cmdp = cmd->cgc.cmd; ++ cmd->sg_io.sbp = cmd->_sense.u; ++ cmd->sg_io.flags = SG_FLAG_LUN_INHIBIT | SG_FLAG_DIRECT_IO; ++} ++ ++static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, unsigned char arg) + { +- if (i == 0) { +- memset(cmd, 0, sizeof(struct scsi_cmd)); +- cmd->cgc.quiet = 1; +- cmd->cgc.sense = &cmd->_sense.s; +- memset(&cmd->sg_io, 0, sizeof(cmd->sg_io)); +- cmd->sg_io.interface_id = 'S'; +- cmd->sg_io.mx_sb_len = sizeof(cmd->_sense); +- cmd->sg_io.cmdp = cmd->cgc.cmd; +- cmd->sg_io.sbp = cmd->_sense.u; +- cmd->sg_io.flags = SG_FLAG_LUN_INHIBIT | SG_FLAG_DIRECT_IO; +- } + cmd->sg_io.cmd_len = i + 1; + cmd->cgc.cmd[i] = arg; + } +@@ -237,7 +240,7 @@ static int cd_inquiry(struct udev *udev, int fd) { + unsigned char inq[128]; + int err; + +- memset(inq, 0, sizeof(inq)); ++ scsi_cmd_init(udev, &sc, inq, sizeof(inq)); + scsi_cmd_set(udev, &sc, 0, 0x12); + scsi_cmd_set(udev, &sc, 4, 36); + scsi_cmd_set(udev, &sc, 5, 0); +@@ -256,109 +259,132 @@ static int cd_inquiry(struct udev *udev, int fd) { + return 0; + } + +-static int cd_profiles(struct udev *udev, int fd) ++static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size) + { +- struct scsi_cmd sc; +- unsigned char header[8]; +- unsigned char profiles[512]; +- unsigned int cur_profile; +- unsigned int len; + unsigned int i; +- int err; +- +- memset(header, 0, sizeof(header)); +- scsi_cmd_set(udev, &sc, 0, 0x46); +- scsi_cmd_set(udev, &sc, 1, 0); +- scsi_cmd_set(udev, &sc, 8, sizeof(header)); +- scsi_cmd_set(udev, &sc, 9, 0); +- err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); +- if ((err < 0)) { +- info_scsi_cmd_err(udev, "GET CONFIGURATION", err); +- return -1; +- } + +- len = 4 + (header[0] << 24 | header[1] << 16 | header[2] << 8 | header[3]); +- info(udev, "GET CONFIGURATION: number of profiles %i\n", len); +- if (len > sizeof(profiles)) { +- info(udev, "invalid number of profiles\n"); +- return -1; +- } +- +- memset(profiles, 0, sizeof(profiles)); +- scsi_cmd_set(udev, &sc, 0, 0x46); +- scsi_cmd_set(udev, &sc, 1, 1); +- scsi_cmd_set(udev, &sc, 6, len >> 16); +- scsi_cmd_set(udev, &sc, 7, len >> 8); +- scsi_cmd_set(udev, &sc, 8, len); +- scsi_cmd_set(udev, &sc, 9, 0); +- err = scsi_cmd_run(udev, &sc, fd, profiles, len); +- if ((err < 0)) { +- info_scsi_cmd_err(udev, "GET CONFIGURATION", err); +- return -1; +- } +- +- /* device profiles */ +- for (i = 12; i < profiles[11]; i += 4) { +- unsigned int profile = (profiles[i] << 8 | profiles[i + 1]); +- if (profile == 0) +- continue; +- info(udev, "profile 0x%02x\n", profile); ++ for (i = 0; i+4 <= size; i += 4) { ++ int profile; + ++ profile = profiles[i] << 8 | profiles[i+1]; + switch (profile) { + case 0x03: + case 0x04: + case 0x05: ++ info(udev, "profile 0x%02x mo\n", profile); + cd_mo = 1; +- break; ++ break; + case 0x10: ++ info(udev, "profile 0x%02x dvd_rom\n", profile); + cd_dvd_rom = 1; + break; + case 0x12: ++ info(udev, "profile 0x%02x dvd_ram\n", profile); + cd_dvd_ram = 1; + break; + case 0x13: + case 0x14: ++ info(udev, "profile 0x%02x dvd_rw\n", profile); + cd_dvd_rw = 1; + break; + case 0x1B: ++ info(udev, "profile 0x%02x dvd_plus_r\n", profile); + cd_dvd_plus_r = 1; + break; + case 0x1A: ++ info(udev, "profile 0x%02x dvd_plus_rw\n", profile); + cd_dvd_plus_rw = 1; + break; + case 0x2A: ++ info(udev, "profile 0x%02x dvd_plus_rw_dl\n", profile); + cd_dvd_plus_rw_dl = 1; + break; + case 0x2B: ++ info(udev, "profile 0x%02x dvd_plus_r_dl\n", profile); + cd_dvd_plus_r_dl = 1; + break; + case 0x40: + cd_bd = 1; ++ info(udev, "profile 0x%02x bd\n", profile); + break; + case 0x41: + case 0x42: + cd_bd_r = 1; ++ info(udev, "profile 0x%02x bd_r\n", profile); + break; + case 0x43: + cd_bd_re = 1; ++ info(udev, "profile 0x%02x bd_re\n", profile); + break; + case 0x50: + cd_hddvd = 1; ++ info(udev, "profile 0x%02x hddvd\n", profile); + break; + case 0x51: + cd_hddvd_r = 1; ++ info(udev, "profile 0x%02x hddvd_r\n", profile); + break; + case 0x52: + cd_hddvd_rw = 1; ++ info(udev, "profile 0x%02x hddvd_rw\n", profile); ++ break; ++ default: ++ info(udev, "profile 0x%02x \n", profile); ++ break; ++ } ++ } ++ return 0; ++} ++ ++static int cd_profiles(struct udev *udev, int fd) ++{ ++ struct scsi_cmd sc; ++ unsigned char features[65530]; ++ unsigned int cur_profile = 0; ++ unsigned int len; ++ unsigned int i; ++ int err; ++ ++ scsi_cmd_init(udev, &sc, features, sizeof(features)); ++ scsi_cmd_set(udev, &sc, 0, 0x46); ++ scsi_cmd_set(udev, &sc, 7, (sizeof(features) >> 8) & 0xff); ++ scsi_cmd_set(udev, &sc, 8, sizeof(features) & 0xff); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features)); ++ if ((err < 0)) { ++ info_scsi_cmd_err(udev, "GET CONFIGURATION", err); ++ return -1; ++ } ++ ++ len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; ++ info(udev, "GET CONFIGURATION: size of features buffer %i\n", len); ++ ++ if (len > sizeof(features)) { ++ info(udev, "can not get features in a single query, truncating\n"); ++ len = sizeof(features); ++ } ++ ++ /* device features */ ++ for (i = 8; i+4 < len; i += (4 + features[i+3])) { ++ unsigned int feature; ++ ++ feature = features[i] << 8 | features[i+1]; ++ ++ switch (feature) { ++ case 0x00: ++ info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4); ++ feature_profiles(udev, &features[i]+4, features[i+3]); ++ ++ /* set current profile, if we got a profiles section */ ++ cur_profile = features[6] << 8 | features[7]; ++ info(udev, "current profile 0x%02x\n", cur_profile); + break; + default: ++ info(udev, "GET CONFIGURATION: feature %i , with %i bytes\n", feature, features[i+3]); + break; + } + } + +- /* current media profile */ +- cur_profile = header[6] << 8 | header[7]; +- info(udev, "current profile 0x%02x\n", cur_profile); + if (cur_profile == 0) { + info(udev, "no current profile, assuming no media\n"); + return -1; +@@ -443,7 +469,7 @@ static int cd_media_info(struct udev *udev, int fd) + }; + int err; + +- memset(header, 0, sizeof(header)); ++ scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x51); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); +@@ -476,7 +502,7 @@ static int cd_media_toc(struct udev *udev, int fd) + unsigned char *p; + int err; + +- memset(header, 0, sizeof(header)); ++ scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, 1); + scsi_cmd_set(udev, &sc, 8, sizeof(header)); +@@ -498,7 +524,7 @@ static int cd_media_toc(struct udev *udev, int fd) + if (len < 8) + return 0; + +- memset(toc, 0, sizeof(toc)); ++ scsi_cmd_init(udev, &sc, toc, sizeof(toc)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ + scsi_cmd_set(udev, &sc, 7, len >> 8); +@@ -526,7 +552,7 @@ static int cd_media_toc(struct udev *udev, int fd) + cd_media_track_count_audio++; + } + +- memset(header, 0, sizeof (header)); ++ scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ + scsi_cmd_set(udev, &sc, 8, 12); +-- +1.7.0.1 + diff --git a/0068-cdrom_id-print-more-debug-messages.patch b/0068-cdrom_id-print-more-debug-messages.patch new file mode 100644 index 0000000..672c1bc --- /dev/null +++ b/0068-cdrom_id-print-more-debug-messages.patch @@ -0,0 +1,121 @@ +From 2e9df1981833e1e029b7ce6c12a44dffb6aad0cb Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 15 Apr 2010 20:48:04 +0200 +Subject: [PATCH 068/110] cdrom_id: print more debug messages + +--- + extras/cdrom_id/cdrom_id.c | 28 +++++++++++++++++++++++----- + 1 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 3f9ca4c..d9b6fbd 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -374,10 +374,6 @@ static int cd_profiles(struct udev *udev, int fd) + case 0x00: + info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4); + feature_profiles(udev, &features[i]+4, features[i+3]); +- +- /* set current profile, if we got a profiles section */ +- cur_profile = features[6] << 8 | features[7]; +- info(udev, "current profile 0x%02x\n", cur_profile); + break; + default: + info(udev, "GET CONFIGURATION: feature %i , with %i bytes\n", feature, features[i+3]); +@@ -385,7 +381,10 @@ static int cd_profiles(struct udev *udev, int fd) + } + } + +- if (cur_profile == 0) { ++ cur_profile = features[6] << 8 | features[7]; ++ if (cur_profile > 0) { ++ info(udev, "current profile 0x%02x\n", cur_profile); ++ } else { + info(udev, "no current profile, assuming no media\n"); + return -1; + } +@@ -396,62 +395,81 @@ static int cd_profiles(struct udev *udev, int fd) + case 0x03: + case 0x04: + case 0x05: ++ info(udev, "profile 0x%02x \n", cur_profile); + cd_media_mo = 1; + break; + case 0x08: ++ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); + cd_media_cd_rom = 1; + break; + case 0x09: ++ info(udev, "profile 0x%02x media_cd_r\n", cur_profile); + cd_media_cd_r = 1; + break; + case 0x0a: ++ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); + cd_media_cd_rw = 1; + break; + case 0x10: ++ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); + cd_media_dvd_rom = 1; + break; + case 0x11: ++ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); + cd_media_dvd_r = 1; + break; + case 0x12: ++ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); + cd_media_dvd_ram = 1; + break; + case 0x13: + case 0x14: ++ info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); + cd_media_dvd_rw = 1; + break; + case 0x1B: ++ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); + cd_media_dvd_plus_r = 1; + break; + case 0x1A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); + cd_media_dvd_plus_rw = 1; + break; + case 0x2A: ++ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); + cd_media_dvd_plus_rw_dl = 1; + break; + case 0x2B: ++ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); + cd_media_dvd_plus_r_dl = 1; + break; + case 0x40: ++ info(udev, "profile 0x%02x media_bd\n", cur_profile); + cd_media_bd = 1; + break; + case 0x41: + case 0x42: ++ info(udev, "profile 0x%02x media_bd_r\n", cur_profile); + cd_media_bd_r = 1; + break; + case 0x43: ++ info(udev, "profile 0x%02x media_bd_re\n", cur_profile); + cd_media_bd_re = 1; + break; + case 0x50: ++ info(udev, "profile 0x%02x media_hddvd\n", cur_profile); + cd_media_hddvd = 1; + break; + case 0x51: ++ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); + cd_media_hddvd_r = 1; + break; + case 0x52: ++ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); + cd_media_hddvd_rw = 1; + break; + default: ++ info(udev, "profile 0x%02x \n", cur_profile); + break; + } + return 0; +-- +1.7.0.1 + diff --git a/0069-cdrom_id-debug-print-feature-values-in-hex.patch b/0069-cdrom_id-debug-print-feature-values-in-hex.patch new file mode 100644 index 0000000..d34d52b --- /dev/null +++ b/0069-cdrom_id-debug-print-feature-values-in-hex.patch @@ -0,0 +1,25 @@ +From 140647ad1aec50e2f657e7838e893a87404ff83a Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 15 Apr 2010 21:18:21 +0200 +Subject: [PATCH 069/110] cdrom_id: debug - print feature values in hex + +--- + extras/cdrom_id/cdrom_id.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index d9b6fbd..b2c107b 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -376,7 +376,7 @@ static int cd_profiles(struct udev *udev, int fd) + feature_profiles(udev, &features[i]+4, features[i+3]); + break; + default: +- info(udev, "GET CONFIGURATION: feature %i , with %i bytes\n", feature, features[i+3]); ++ info(udev, "GET CONFIGURATION: feature 0x%04x , with 0x%02x bytes\n", feature, features[i+3]); + break; + } + } +-- +1.7.0.1 + diff --git a/0070-cdrom_id-debug-print-feature-values-in-hex.patch b/0070-cdrom_id-debug-print-feature-values-in-hex.patch new file mode 100644 index 0000000..1ff0b25 --- /dev/null +++ b/0070-cdrom_id-debug-print-feature-values-in-hex.patch @@ -0,0 +1,25 @@ +From a60b077a465b19af2efd9bf0cb5f0f67117be780 Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Thu, 15 Apr 2010 21:22:38 +0200 +Subject: [PATCH 070/110] cdrom_id: debug - print feature values in hex + +--- + extras/cdrom_id/cdrom_id.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index b2c107b..16b1260 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -357,7 +357,7 @@ static int cd_profiles(struct udev *udev, int fd) + } + + len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3]; +- info(udev, "GET CONFIGURATION: size of features buffer %i\n", len); ++ info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len); + + if (len > sizeof(features)) { + info(udev, "can not get features in a single query, truncating\n"); +-- +1.7.0.1 + diff --git a/0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch b/0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch new file mode 100644 index 0000000..b5543bf --- /dev/null +++ b/0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch @@ -0,0 +1,79 @@ +From 58e178894bfc040834e1270c6fe9b9fdef513550 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Thu, 15 Apr 2010 08:56:48 +0200 +Subject: [PATCH 071/110] cdrom_id: Do not ignore errors from scsi_cmd_run() + +scsi_cmd_run() can return positive error messages if we have CHECK_CONDITION +set and get the error code from the SCSI command result. So check the result +for non-zero, not for being negative. + +This should fix another cause for "phantom" media in empty CD-ROM drives. + +Thanks to Mike Brudevold for spotting this! + +https://launchpad.net/bugs/562978 +--- + extras/cdrom_id/cdrom_id.c | 12 ++++++------ + 1 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 16b1260..37212e9 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -245,7 +245,7 @@ static int cd_inquiry(struct udev *udev, int fd) { + scsi_cmd_set(udev, &sc, 4, 36); + scsi_cmd_set(udev, &sc, 5, 0); + err = scsi_cmd_run(udev, &sc, fd, inq, 36); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "INQUIRY", err); + return -1; + } +@@ -351,7 +351,7 @@ static int cd_profiles(struct udev *udev, int fd) + scsi_cmd_set(udev, &sc, 8, sizeof(features) & 0xff); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features)); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "GET CONFIGURATION", err); + return -1; + } +@@ -492,7 +492,7 @@ static int cd_media_info(struct udev *udev, int fd) + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); + return -1; + }; +@@ -526,7 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "READ TOC", err); + return -1; + } +@@ -549,7 +549,7 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_set(udev, &sc, 8, len); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, toc, len); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "READ TOC (tracks)", err); + return -1; + } +@@ -576,7 +576,7 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_set(udev, &sc, 8, 12); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); +- if ((err < 0)) { ++ if ((err != 0)) { + info_scsi_cmd_err(udev, "READ TOC (multi session)", err); + return -1; + } +-- +1.7.0.1 + diff --git a/0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch b/0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch new file mode 100644 index 0000000..2865983 --- /dev/null +++ b/0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch @@ -0,0 +1,38 @@ +From 30e3b1a0d3a3ec76f16736470dc656744848d941 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Thu, 15 Apr 2010 21:25:57 +0200 +Subject: [PATCH 072/110] cdrom_id: Swap media state and TOC info probing + +Blank CDs do not have a TOC, thus will fail cd_media_toc() (at least with the +"Do not ignore errors from scsi_cmd_run()" fix). Thus probe the media state +first, so that we can properly detect blank media. +--- + extras/cdrom_id/cdrom_id.c | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 37212e9..722b8f8 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -681,14 +681,14 @@ int main(int argc, char *argv[]) + if (cd_profiles(udev, fd) < 0) + goto print; + +- /* get session/track info */ +- if (cd_media_toc(udev, fd) < 0) +- goto print; +- + /* get writable media state */ + if (cd_media_info(udev, fd) < 0) + goto print; + ++ /* get session/track info */ ++ if (cd_media_toc(udev, fd) < 0) ++ goto print; ++ + print: + printf("ID_CDROM=1\n"); + if (cd_cd_rom) +-- +1.7.0.1 + diff --git a/0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch b/0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch new file mode 100644 index 0000000..26e92b1 --- /dev/null +++ b/0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch @@ -0,0 +1,36 @@ +From 7c07740ce7b0941844b15573449a730283d5bba5 Mon Sep 17 00:00:00 2001 +From: Mike Brudevold +Date: Thu, 15 Apr 2010 19:55:50 -0500 +Subject: [PATCH 074/110] cdrom_id: add missing profiles to feature_profiles + +Signed-off-by: Mike Brudevold +--- + extras/cdrom_id/cdrom_id.c | 12 ++++++++++++ + 1 files changed, 12 insertions(+), 0 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 722b8f8..da2785e 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -274,6 +274,18 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si + info(udev, "profile 0x%02x mo\n", profile); + cd_mo = 1; + break; ++ case 0x08: ++ info(udev, "profile 0x%02x cd_rom\n", profile); ++ cd_cd_rom = 1; ++ break; ++ case 0x09: ++ info(udev, "profile 0x%02x cd_r\n", profile); ++ cd_cd_r = 1; ++ break; ++ case 0x0A: ++ info(udev, "profile 0x%02x cd_rw\n", profile); ++ cd_cd_rw = 1; ++ break; + case 0x10: + info(udev, "profile 0x%02x dvd_rom\n", profile); + cd_dvd_rom = 1; +-- +1.7.0.1 + diff --git a/0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch b/0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch new file mode 100644 index 0000000..091bba3 --- /dev/null +++ b/0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch @@ -0,0 +1,183 @@ +From bc913ce47821ed030437ec9b25507b5dd52b59cb Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Sat, 17 Apr 2010 19:31:44 +0200 +Subject: [PATCH 075/110] cdrom_id: set ID_CDROM_MEDIA=1 only for known media + +On Sat, Apr 17, 2010 at 18:26, Mike Brudevold wrote: +> My CD-RW drive experiences a problem in that it automatically closes +> after opening if there is media in the drive. This only happens if +> there was media in the drive when it was last closed (an empty drive +> stays open). +... +> cd_profiles: current profile 0x02 +> cd_profiles: profile 0x02 +... + +Do not pretend to have a media, when we receive a profile like 0x02, +which just means "Removable disk". + +Thanks to Mike Brudevold for the initial patch. +--- + extras/cdrom_id/cdrom_id.c | 33 +++++++++++++++++++++++++-------- + 1 files changed, 25 insertions(+), 8 deletions(-) + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index da2785e..935f117 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -401,83 +401,99 @@ static int cd_profiles(struct udev *udev, int fd) + return -1; + } + +- cd_media = 1; +- + switch (cur_profile) { + case 0x03: + case 0x04: + case 0x05: + info(udev, "profile 0x%02x \n", cur_profile); ++ cd_media = 1; + cd_media_mo = 1; + break; + case 0x08: + info(udev, "profile 0x%02x media_cd_rom\n", cur_profile); ++ cd_media = 1; + cd_media_cd_rom = 1; + break; + case 0x09: + info(udev, "profile 0x%02x media_cd_r\n", cur_profile); ++ cd_media = 1; + cd_media_cd_r = 1; + break; + case 0x0a: + info(udev, "profile 0x%02x media_cd_rw\n", cur_profile); ++ cd_media = 1; + cd_media_cd_rw = 1; + break; + case 0x10: + info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_rom = 1; + break; + case 0x11: + info(udev, "profile 0x%02x media_dvd_r\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_r = 1; + break; + case 0x12: + info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_ram = 1; + break; + case 0x13: + case 0x14: + info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_rw = 1; + break; + case 0x1B: + info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_plus_r = 1; + break; + case 0x1A: + info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_plus_rw = 1; + break; + case 0x2A: + info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_plus_rw_dl = 1; + break; + case 0x2B: + info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile); ++ cd_media = 1; + cd_media_dvd_plus_r_dl = 1; + break; + case 0x40: + info(udev, "profile 0x%02x media_bd\n", cur_profile); ++ cd_media = 1; + cd_media_bd = 1; + break; + case 0x41: + case 0x42: + info(udev, "profile 0x%02x media_bd_r\n", cur_profile); ++ cd_media = 1; + cd_media_bd_r = 1; + break; + case 0x43: + info(udev, "profile 0x%02x media_bd_re\n", cur_profile); ++ cd_media = 1; + cd_media_bd_re = 1; + break; + case 0x50: + info(udev, "profile 0x%02x media_hddvd\n", cur_profile); ++ cd_media = 1; + cd_media_hddvd = 1; + break; + case 0x51: + info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile); ++ cd_media = 1; + cd_media_hddvd_r = 1; + break; + case 0x52: + info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile); ++ cd_media = 1; + cd_media_hddvd_rw = 1; + break; + default: +@@ -501,7 +517,7 @@ static int cd_media_info(struct udev *udev, int fd) + + scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x51); +- scsi_cmd_set(udev, &sc, 8, sizeof(header)); ++ scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { +@@ -509,10 +525,11 @@ static int cd_media_info(struct udev *udev, int fd) + return -1; + }; + ++ cd_media = 1; + info(udev, "disk type %02x\n", header[8]); + + /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ +- if (!cd_media_cd_rom && (header[2] & 3) < 4) ++ if (!cd_media_cd_rom) + cd_media_state = media_status[header[2] & 3]; + + if ((header[2] & 3) != 2) +@@ -535,7 +552,7 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, 1); +- scsi_cmd_set(udev, &sc, 8, sizeof(header)); ++ scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { +@@ -557,8 +574,8 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_init(udev, &sc, toc, sizeof(toc)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */ +- scsi_cmd_set(udev, &sc, 7, len >> 8); +- scsi_cmd_set(udev, &sc, 8, len); ++ scsi_cmd_set(udev, &sc, 7, (len >> 8) & 0xff); ++ scsi_cmd_set(udev, &sc, 8, len & 0xff); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, toc, len); + if ((err != 0)) { +@@ -585,7 +602,7 @@ static int cd_media_toc(struct udev *udev, int fd) + scsi_cmd_init(udev, &sc, header, sizeof(header)); + scsi_cmd_set(udev, &sc, 0, 0x43); + scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */ +- scsi_cmd_set(udev, &sc, 8, 12); ++ scsi_cmd_set(udev, &sc, 8, sizeof(header)); + scsi_cmd_set(udev, &sc, 9, 0); + err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); + if ((err != 0)) { +-- +1.7.0.1 + diff --git a/0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch b/0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch new file mode 100644 index 0000000..cc4a088 --- /dev/null +++ b/0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch @@ -0,0 +1,26 @@ +From 155e313bfda594b3d8e2a31d48f341765bdfa75d Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Tue, 27 Apr 2010 12:22:42 +0200 +Subject: [PATCH 110/110] cdrom_id: only mark sr[0-9]* as ID_CDROM + +we cannot be sure for xvd* +--- + extras/cdrom_id/60-cdrom_id.rules | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules +index 16b3af9..b3109f1 100644 +--- a/extras/cdrom_id/60-cdrom_id.rules ++++ b/extras/cdrom_id/60-cdrom_id.rules +@@ -5,7 +5,7 @@ SUBSYSTEM!="block", GOTO="cdrom_end" + KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" + ENV{DEVTYPE}!="disk", GOTO="cdrom_end" + +-ENV{ID_CDROM}="1" ++KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1" + IMPORT{program}="cdrom_id --export $tempnode" + + LABEL="cdrom_end" +-- +1.7.0.1 + diff --git a/Makefile b/Makefile deleted file mode 100644 index 39ea178..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# Makefile for source rpm: udev -# $Id$ -NAME := udev -SPECFILE = $(firstword $(wildcard *.spec)) - -include ../common/Makefile.common diff --git a/Makefile.git b/Makefile.git new file mode 100644 index 0000000..ea5486a --- /dev/null +++ b/Makefile.git @@ -0,0 +1,6 @@ +Patch: + @for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "Patch$$n: $$i";done + +patch: + @for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "%patch$$n -p1 -b .git$$n";done + diff --git a/ck-runseat.patch b/ck-runseat.patch new file mode 100644 index 0000000..8804bc7 --- /dev/null +++ b/ck-runseat.patch @@ -0,0 +1,295 @@ +--- udev-145/extras/udev-acl/Makefile.am.runseat 2009-06-16 19:47:37.000000000 -0400 ++++ udev-145/extras/udev-acl/Makefile.am 2009-09-25 20:21:41.959583372 -0400 +@@ -15,5 +15,5 @@ udev_acl_LDADD = \ + dist_udevrules_DATA = 70-acl.rules + + install-exec-hook: +- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d +- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/udev-acl.ck ++ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d ++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck +--- udev-145/extras/udev-acl/udev-acl.c.runseat 2009-06-16 12:10:58.000000000 -0400 ++++ udev-145/extras/udev-acl/udev-acl.c 2009-09-25 20:57:32.502573825 -0400 +@@ -1,4 +1,5 @@ +-/* ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * + * Copyright (C) 2009 Kay Sievers + * + * This program is free software; you can redistribute it and/or +@@ -29,6 +30,13 @@ + + static int debug; + ++enum{ ++ ACTION_NONE = 0, ++ ACTION_REMOVE, ++ ACTION_ADD, ++ ACTION_CHANGE ++}; ++ + static int set_facl(const char* filename, uid_t uid, int add) + { + int get; +@@ -152,44 +160,123 @@ static GSList *uids_with_local_active_se + } + + /* ConsoleKit calls us with special variables */ +-static int consolekit_called(const char *action, uid_t *uid, const char **own_session, int *add) ++static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, const char **remove_session_id, int *action) + { +- int a; +- uid_t u; ++ int a = ACTION_NONE; ++ uid_t u = 0; ++ uid_t u2 = 0; + const char *s; +- const char *session; +- +- if (action == NULL || strcmp(action, "session_active_changed") != 0) +- return -1; ++ const char *s2; ++ const char *old_session = NULL; + +- s = getenv("CK_SESSION_IS_LOCAL"); +- if (s == NULL) ++ if (ck_action == NULL || strcmp(ck_action, "seat_active_session_changed") != 0) + return -1; +- if (strcmp(s, "true") != 0) +- return 0; + +- s = getenv("CK_SESSION_IS_ACTIVE"); +- if (s == NULL) ++ /* We can have one of: remove, add, change, no-change */ ++ s = getenv("CK_SEAT_OLD_SESSION_ID"); ++ s2 = getenv("CK_SEAT_SESSION_ID"); ++ if (s == NULL && s2 == NULL) { + return -1; +- if (strcmp(s, "true") == 0) +- a = 1; +- else +- a = 0; ++ } else if (s2 == NULL) { ++ a = ACTION_REMOVE; ++ } else if (s == NULL) { ++ a = ACTION_ADD; ++ } else { ++ a = ACTION_CHANGE; ++ } + +- session = getenv("CK_SESSION_ID"); +- if (session == NULL) +- return -1; ++ switch (a) { ++ case ACTION_ADD: ++ s = getenv("CK_SEAT_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_SESSION_IS_LOCAL"); ++ if (s == NULL) ++ return -1; ++ if (strcmp(s, "true") != 0) ++ return 0; ++ ++ break; ++ case ACTION_REMOVE: ++ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); ++ if (s == NULL) ++ return -1; ++ if (strcmp(s, "true") != 0) ++ return 0; ++ ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ ++ break; ++ case ACTION_CHANGE: ++ s = getenv("CK_SEAT_OLD_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u = strtoul(s, NULL, 10); ++ if (u == 0) ++ return 0; ++ s = getenv("CK_SEAT_SESSION_USER_UID"); ++ if (s == NULL) ++ return -1; ++ u2 = strtoul(s, NULL, 10); ++ if (u2 == 0) ++ return 0; ++ ++ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL"); ++ s2 = getenv("CK_SEAT_SESSION_IS_LOCAL"); ++ if (s == NULL || s2 == NULL) ++ return -1; ++ /* don't process non-local session changes */ ++ if (strcmp(s, "true") != 0 && strcmp(s2, "true") != 0) ++ return 0; ++ ++ if (strcmp(s, "true") == 0 && strcmp(s, "true") == 0) { ++ /* process the change */ ++ if (u == u2) { ++ /* special case: we noop if we are ++ * changing between local sessions for ++ * the same uid */ ++ a = ACTION_NONE; ++ } ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ } else if (strcmp(s, "true") == 0) { ++ /* only process the removal */ ++ a = ACTION_REMOVE; ++ old_session = getenv("CK_SEAT_OLD_SESSION_ID"); ++ if (old_session == NULL) ++ return -1; ++ } else if (strcmp(s2, "true") == 0) { ++ /* only process the addition */ ++ a = ACTION_ADD; ++ u = u2; ++ } + +- s = getenv("CK_SESSION_USER_UID"); +- if (s == NULL) +- return -1; +- u = strtoul(s, NULL, 10); +- if (u == 0) +- return 0; ++ break; ++ case ACTION_NONE: ++ break; ++ default: ++ g_assert_not_reached (); ++ break; ++ } + +- *own_session = session; ++ *remove_session_id = old_session; + *uid = u; +- *add = a; ++ *uid2 = u2; ++ *action = a; + return 0; + } + +@@ -223,6 +310,21 @@ static void apply_acl_to_devices(uid_t u + udev_unref(udev); + } + ++static void ++remove_uid (uid_t uid, const char *remove_session_id) ++{ ++ /* ++ * Remove ACL for given uid from all matching devices ++ * when there is currently no local active session. ++ */ ++ GSList *list; ++ ++ list = uids_with_local_active_session(remove_session_id); ++ if (!uid_in_list(list, uid)) ++ apply_acl_to_devices(uid, 0); ++ g_slist_free(list); ++} ++ + int main (int argc, char* argv[]) + { + static const struct option options[] = { +@@ -233,10 +335,11 @@ int main (int argc, char* argv[]) + { "help", no_argument, NULL, 'h' }, + {} + }; +- int add = -1; ++ int action = -1; + const char *device = NULL; + uid_t uid = 0; +- const char* own_session = NULL; ++ uid_t uid2 = 0; ++ const char* remove_session_id = NULL; + int rc = 0; + + /* valgrind is more important to us than a slice allocator */ +@@ -252,9 +355,9 @@ int main (int argc, char* argv[]) + switch (option) { + case 'a': + if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0) +- add = 1; ++ action = ACTION_ADD; + else if (strcmp(optarg, "remove") == 0) +- add = 0; ++ action = ACTION_REMOVE; + else + goto out; + break; +@@ -274,10 +377,10 @@ int main (int argc, char* argv[]) + } + } + +- if (add < 0 && device == NULL && uid == 0) +- consolekit_called(argv[optind], &uid, &own_session, &add); ++ if (action < 0 && device == NULL && uid == 0) ++ consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action); + +- if (add < 0) { ++ if (action < 0) { + fprintf(stderr, "missing action\n\n"); + rc = 2; + goto out; +@@ -290,20 +393,24 @@ int main (int argc, char* argv[]) + } + + if (uid != 0) { +- if (add) { ++ switch (action) { ++ case ACTION_ADD: + /* Add ACL for given uid to all matching devices. */ + apply_acl_to_devices(uid, 1); +- } else { +- /* +- * Remove ACL for given uid from all matching devices +- * when there is currently no local active session. +- */ +- GSList *list; +- +- list = uids_with_local_active_session(own_session); +- if (!uid_in_list(list, uid)) +- apply_acl_to_devices(uid, 0); +- g_slist_free(list); ++ break; ++ case ACTION_REMOVE: ++ remove_uid(uid, remove_session_id); ++ break; ++ case ACTION_CHANGE: ++ remove_uid(uid, remove_session_id); ++ apply_acl_to_devices(uid2, 1); ++ break; ++ case ACTION_NONE: ++ goto out; ++ break; ++ default: ++ g_assert_not_reached(); ++ break; + } + } else if (device != NULL) { + /* +@@ -321,8 +428,8 @@ int main (int argc, char* argv[]) + uid_t u; + + u = GPOINTER_TO_UINT(l->data); +- if (add || !uid_in_list(list, u)) +- set_facl(device, u, add); ++ if (action == ACTION_ADD || !uid_in_list(list, u)) ++ set_facl(device, u, action == ACTION_ADD); + } + g_slist_free(list); + } else { diff --git a/fw_unit_symlinks.sh b/fw_unit_symlinks.sh new file mode 100644 index 0000000..c4cdd6b --- /dev/null +++ b/fw_unit_symlinks.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +SYSFS=/sys +NAME=$1 +NUM=$2 + +for i in "${SYSFS}${DEVPATH}/${NAME}.*/specifier_id"; do + if [ ! -f "$i" ]; then + continue + fi + SPECID="`cat $i`" + if [ $((SPECID)) -eq $((0x00609e)) ]; then + echo -n "sbp2-${NUM} " + elif [ $((SPECID)) -eq $((0x00a02d)) ]; then + SWVER="`cat ${i%/specifier_id}/version`" + if [ $((SWVER)) -ge $((0x100)) -a $((SWVER)) -lt $((0x110)) ]; then + echo -n "iidc${NUM} " + elif [ $((SWVER)) -eq $((0x10001)) ]; then + echo -n "avc${NUM} " + elif [ $((SWVER)) -ge $((0x14000)) -a $((SWVER)) -le $((0x14001)) ]; then + echo -n "vendorfw${NUM} " + fi + fi +done +echo diff --git a/hid2hci.patch b/hid2hci.patch new file mode 100644 index 0000000..d932677 --- /dev/null +++ b/hid2hci.patch @@ -0,0 +1,624 @@ +diff -u udev-145/extras/hid2hci/70-hid2hci.rules /home/harald/git/udev/extras/hid2hci/70-hid2hci.rules +--- udev-145/extras/hid2hci/70-hid2hci.rules 2009-06-28 02:07:53.000000000 +0200 ++++ udev/extras/hid2hci/70-hid2hci.rules 2009-09-16 16:48:40.000000000 +0200 +@@ -1,25 +1,28 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add", GOTO="hid2hci_end" ++ACTION!="add|change", GOTO="hid2hci_end" + SUBSYSTEM!="usb", GOTO="hid2hci_end" + +-# Variety of Dell Bluetooth devices - it looks like a bit of an odd rule, +-# because it is matching on a mouse device that is self powered, but that +-# is where a HID report needs to be sent to switch modes. +-# ++# Variety of Dell Bluetooth devices - match on a mouse device that is ++# self powered and where a HID report needs to be sent to switch modes + # Known supported devices: 413c:8154, 413c:8158, 413c:8162 +-ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ +- RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci" ++ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", \ ++ ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ ++ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" ++ ++# Logitech devices (hidraw) ++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ ++ RUN+="hid2hci --method=logitech-hid --devpath=%p" + + ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" + +-# Logitech devices +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" +- +-# CSR devices (in HID mode) +-ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" ++# When a Dell device recovers from S3, the mouse child needs to be repoked ++# Unfortunately the only event seen is the BT device disappearing, so the mouse ++# device needs to be chased down on the USB bus. ++ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \ ++ ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1" ++ ++# CSR devices ++ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p" + + LABEL="hid2hci_end" +diff -u udev-145/extras/hid2hci/hid2hci.c /home/harald/git/udev/extras/hid2hci/hid2hci.c +--- udev-145/extras/hid2hci/hid2hci.c 2009-06-13 02:55:10.000000000 +0200 ++++ udev/extras/hid2hci/hid2hci.c 2009-08-13 11:23:30.000000000 +0200 +@@ -1,31 +1,26 @@ + /* ++ * hid2hci : switch the radio on devices that support ++ * it from HID to HCI and back + * +- * hid2hci : a tool for switching the radio on devices that support +- * it from HID to HCI and back ++ * Copyright (C) 2003-2009 Marcel Holtmann ++ * Copyright (C) 2008-2009 Mario Limonciello ++ * Copyright (C) 2009 Kay Sievers + * +- * Copyright (C) 2003-2009 Marcel Holtmann +- * Copyright (C) 2008-2009 Mario Limonciello ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. + * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. + * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#ifdef HAVE_CONFIG_H +-#include +-#endif +- + #include + #include + #include +@@ -33,79 +28,24 @@ + #include + #include + #include +- ++#include + #include + +-#ifdef NEED_USB_GET_BUSSES +-static inline struct usb_bus *usb_get_busses(void) +-{ +- return usb_busses; +-} +-#endif +- +-#ifndef USB_DIR_OUT +-#define USB_DIR_OUT 0x00 +-#endif +- +-static char devpath[PATH_MAX + 1] = "/dev"; +- +-struct hiddev_devinfo { +- unsigned int bustype; +- unsigned int busnum; +- unsigned int devnum; +- unsigned int ifnum; +- short vendor; +- short product; +- short version; +- unsigned num_applications; +-}; +- +-struct hiddev_report_info { +- unsigned report_type; +- unsigned report_id; +- unsigned num_fields; +-}; +- +-typedef __signed__ int __s32; ++#include "libudev.h" ++#include "libudev-private.h" + +-struct hiddev_usage_ref { +- unsigned report_type; +- unsigned report_id; +- unsigned field_index; +- unsigned usage_index; +- unsigned usage_code; +- __s32 value; ++enum mode { ++ HCI = 0, ++ HID = 1, + }; + +-#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo) +-#define HIDIOCINITREPORT _IO('H', 0x05) +-#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info) +-#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref) +- +-#define HID_REPORT_TYPE_OUTPUT 2 +- +-#define HCI 0 +-#define HID 1 +- +-struct device_info { +- struct usb_device *dev; +- int mode; +- uint16_t vendor; +- uint16_t product; +-}; +- +-static int switch_csr(struct device_info *devinfo) ++static int usb_switch_csr(struct usb_dev_handle *dev, enum mode mode) + { +- struct usb_dev_handle *udev; + int err; + +- udev = usb_open(devinfo->dev); +- if (!udev) +- return -errno; +- +- err = usb_control_msg(udev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, +- 0, devinfo->mode, 0, NULL, 0, 10000); +- ++ err = usb_control_msg(dev, ++ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, ++ 0, mode, 0, NULL, 0, 10000); + if (err == 0) { + err = -1; + errno = EALREADY; +@@ -113,13 +53,10 @@ + if (errno == ETIMEDOUT) + err = 0; + } +- +- usb_close(udev); +- + return err; + } + +-static int send_report(int fd, const char *buf, size_t size) ++static int hid_logitech_send_report(int fd, const char *buf, size_t size) + { + struct hiddev_report_info rinfo; + struct hiddev_usage_ref uref; +@@ -148,72 +85,42 @@ + return err; + } + +-static int switch_logitech(struct device_info *devinfo) ++static int hid_switch_logitech(const char *filename) + { +- char devname[PATH_MAX + 1]; +- int i, fd, err = -1; +- +- for (i = 0; i < 16; i++) { +- struct hiddev_devinfo dinfo; +- char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 }; +- char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 }; +- char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 }; +- +- sprintf(devname, "%s/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) { +- sprintf(devname, "%s/usb/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) { +- sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) +- continue; +- } +- } +- +- memset(&dinfo, 0, sizeof(dinfo)); +- err = ioctl(fd, HIDIOCGDEVINFO, &dinfo); +- if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) || +- (int) dinfo.devnum != atoi(devinfo->dev->filename)) { +- close(fd); +- continue; +- } +- +- err = ioctl(fd, HIDIOCINITREPORT, 0); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep1, sizeof(rep1)); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep2, sizeof(rep2)); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep3, sizeof(rep3)); +- close(fd); +- break; +- } +- ++ char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 }; ++ char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 }; ++ char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 }; ++ int fd; ++ int err = -1; ++ ++ fd = open(filename, O_RDWR); ++ if (fd < 0) ++ return err; ++ ++ err = ioctl(fd, HIDIOCINITREPORT, 0); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep1, sizeof(rep1)); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep2, sizeof(rep2)); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep3, sizeof(rep3)); ++out: ++ close(fd); + return err; + } + +-static int switch_dell(struct device_info *devinfo) ++static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) + { + char report[] = { 0x7f, 0x00, 0x00, 0x00 }; +- +- struct usb_dev_handle *handle; + int err; + +- switch (devinfo->mode) { ++ switch (mode) { + case HCI: + report[1] = 0x13; + break; +@@ -222,22 +129,16 @@ + break; + } + +- handle = usb_open(devinfo->dev); +- if (!handle) +- return -EIO; +- + /* Don't need to check return, as might not be in use */ +- usb_detach_kernel_driver_np(handle, 0); ++ usb_detach_kernel_driver_np(dev, 0); + +- if (usb_claim_interface(handle, 0) < 0) { +- usb_close(handle); ++ if (usb_claim_interface(dev, 0) < 0) + return -EIO; +- } + +- err = usb_control_msg(handle, +- USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, ++ err = usb_control_msg(dev, ++ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, +- report, sizeof(report), 5000); ++ report, sizeof(report), 5000); + + if (err == 0) { + err = -1; +@@ -246,131 +147,203 @@ + if (errno == ETIMEDOUT) + err = 0; + } +- +- usb_close(handle); +- + return err; + } + +-static int find_device(struct device_info* devinfo) ++/* ++ * The braindead libusb needs to scan and open all devices, just to ++ * to find the device we already have. This needs to be fixed in libusb ++ * or it will be ripped out and we carry our own code. ++ */ ++static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev) + { + struct usb_bus *bus; +- struct usb_device *dev; ++ const char *str; ++ int busnum; ++ int devnum; ++ ++ str = udev_device_get_sysattr_value(usb_dev, "busnum"); ++ if (str == NULL) ++ return NULL; ++ busnum = strtol(str, NULL, 0); ++ ++ str = udev_device_get_sysattr_value(usb_dev, "devnum"); ++ if (str == NULL) ++ return NULL; ++ devnum = strtol(str, NULL, 0); + ++ usb_init(); + usb_find_busses(); + usb_find_devices(); + +- for (bus = usb_get_busses(); bus; bus = bus->next) ++ for (bus = usb_get_busses(); bus; bus = bus->next) { ++ struct usb_device *dev; ++ ++ if (strtol(bus->dirname, NULL, 10) != busnum) ++ continue; ++ + for (dev = bus->devices; dev; dev = dev->next) { +- if (dev->descriptor.idVendor == devinfo->vendor && +- dev->descriptor.idProduct == devinfo->product) { +- devinfo->dev=dev; +- return 1; +- } ++ if (dev->devnum == devnum) ++ return dev; + } +- return 0; ++ } ++ ++ return NULL; ++} ++ ++static struct usb_dev_handle *find_device(struct udev_device *udev_dev) ++{ ++ struct usb_device *dev; ++ ++ dev = usb_device_open_from_udev(udev_dev); ++ if (dev == NULL) ++ return NULL; ++ return usb_open(dev); + } + +-static void usage(char* error) ++static void usage(const char *error) + { + if (error) + fprintf(stderr,"\n%s\n", error); + else + printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n"); + +- printf("Usage:\n" +- "\thid2hci [options]\n" +- "\n"); +- +- printf("Options:\n" +- "\t-h, --help Display help\n" +- "\t-q, --quiet Don't display any messages\n" +- "\t-r, --mode= Mode to switch to [hid, hci]\n" +- "\t-v, --vendor= Vendor ID to act upon\n" +- "\t-p, --product= Product ID to act upon\n" +- "\t-m, --method= Method to use to switch [csr, logitech, dell]\n" +- "\n"); +- if (error) +- exit(1); ++ printf("Usage: hid2hci [options]\n" ++ " --mode= mode to switch to [hid|hci] (default hci)\n" ++ " --devpath= sys device path\n" ++ " --method= method to use to switch [csr|logitech-hid|dell]\n" ++ " --help\n\n"); + } + +-static const struct option main_options[] = { +- { "help", no_argument, 0, 'h' }, +- { "quiet", no_argument, 0, 'q' }, +- { "mode", required_argument, 0, 'r' }, +- { "vendor", required_argument, 0, 'v' }, +- { "product", required_argument, 0, 'p' }, +- { "method", required_argument, 0, 'm' }, +- { 0, 0, 0, 0 } +-}; +- + int main(int argc, char *argv[]) + { +- struct device_info dev = { NULL, HCI, 0, 0 }; +- int opt, quiet = 0; +- int (*method)(struct device_info *dev) = NULL; +- +- while ((opt = getopt_long(argc, argv, "+r:v:p:m:qh", main_options, NULL)) != -1) { +- switch (opt) { +- case 'r': +- if (optarg && !strcmp(optarg, "hid")) +- dev.mode = HID; +- else if (optarg && !strcmp(optarg, "hci")) +- dev.mode = HCI; +- else +- usage("ERROR: Undefined radio mode\n"); ++ static const struct option options[] = { ++ { "help", no_argument, NULL, 'h' }, ++ { "mode", required_argument, NULL, 'm' }, ++ { "devpath", required_argument, NULL, 'p' }, ++ { "method", required_argument, NULL, 'M' }, ++ { } ++ }; ++ enum method { ++ METHOD_UNDEF, ++ METHOD_CSR, ++ METHOD_LOGITECH_HID, ++ METHOD_DELL, ++ } method = METHOD_UNDEF; ++ struct udev *udev; ++ struct udev_device *udev_dev = NULL; ++ char syspath[UTIL_PATH_SIZE]; ++ int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL; ++ enum mode mode = HCI; ++ const char *devpath = NULL; ++ int err = -1; ++ int rc = 1; ++ ++ for (;;) { ++ int option; ++ ++ option = getopt_long(argc, argv, "m:p:M:qh", options, NULL); ++ if (option == -1) + break; +- case 'v': +- sscanf(optarg, "%4hx", &dev.vendor); ++ ++ switch (option) { ++ case 'm': ++ if (!strcmp(optarg, "hid")) { ++ mode = HID; ++ } else if (!strcmp(optarg, "hci")) { ++ mode = HCI; ++ } else { ++ usage("error: undefined radio mode\n"); ++ exit(1); ++ } + break; + case 'p': +- sscanf(optarg, "%4hx", &dev.product); +- break; +- case 'm': +- if (optarg && !strcmp(optarg, "csr")) +- method = switch_csr; +- else if (optarg && !strcmp(optarg, "logitech")) +- method = switch_logitech; +- else if (optarg && !strcmp(optarg, "dell")) +- method = switch_dell; +- else +- usage("ERROR: Undefined switching method\n"); ++ devpath = optarg; + break; +- case 'q': +- quiet = 1; ++ case 'M': ++ if (!strcmp(optarg, "csr")) { ++ method = METHOD_CSR; ++ usb_switch = usb_switch_csr; ++ } else if (!strcmp(optarg, "logitech-hid")) { ++ method = METHOD_LOGITECH_HID; ++ } else if (!strcmp(optarg, "dell")) { ++ method = METHOD_DELL; ++ usb_switch = usb_switch_dell; ++ } else { ++ usage("error: undefined switching method\n"); ++ exit(1); ++ } + break; + case 'h': + usage(NULL); + default: +- exit(0); ++ exit(1); + } + } + +- if (!quiet && (!dev.vendor || !dev.product || !method)) +- usage("ERROR: Vendor ID, Product ID, and Switching Method must all be defined.\n"); ++ if (!devpath || method == METHOD_UNDEF) { ++ usage("error: --devpath= and --method= must be defined\n"); ++ exit(1); ++ } + +- argc -= optind; +- argv += optind; +- optind = 0; ++ udev = udev_new(); ++ if (udev == NULL) ++ goto exit; ++ ++ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); ++ udev_dev = udev_device_new_from_syspath(udev, syspath); ++ if (udev_dev == NULL) { ++ fprintf(stderr, "error: could not find '%s'\n", devpath); ++ goto exit; ++ } + +- usb_init(); ++ switch (method) { ++ case METHOD_CSR: ++ case METHOD_DELL: { ++ struct udev_device *dev; ++ struct usb_dev_handle *handle; ++ const char *type; ++ ++ /* get the parent usb_device if needed */ ++ dev = udev_dev; ++ type = udev_device_get_devtype(dev); ++ if (type == NULL || strcmp(type, "usb_device") != 0) { ++ dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"); ++ if (dev == NULL) { ++ fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath); ++ goto exit; ++ } ++ } + +- if (!find_device(&dev)) { +- if (!quiet) +- fprintf(stderr, "Device %04x:%04x not found on USB bus.\n", +- dev.vendor, dev.product); +- exit(1); ++ handle = find_device(dev); ++ if (handle == NULL) { ++ fprintf(stderr, "error: unable to handle '%s'\n", ++ udev_device_get_syspath(dev)); ++ goto exit; ++ } ++ err = usb_switch(handle, mode); ++ break; + } ++ case METHOD_LOGITECH_HID: { ++ const char *device; + +- if (!quiet) +- printf("Attempting to switch device %04x:%04x to %s mode ", +- dev.vendor, dev.product, dev.mode ? "HID" : "HCI"); +- fflush(stdout); +- +- if (method(&dev) < 0 && !quiet) +- printf("failed (%s)\n", strerror(errno)); +- else if (!quiet) +- printf("was successful\n"); ++ device = udev_device_get_devnode(udev_dev); ++ if (device == NULL) { ++ fprintf(stderr, "error: could not find hiddev device node\n"); ++ goto exit; ++ } ++ err = hid_switch_logitech(device); ++ break; ++ } ++ default: ++ break; ++ } + +- return errno; ++ if (err < 0) ++ fprintf(stderr, "error: switching device '%s' failed.\n", ++ udev_device_get_syspath(udev_dev)); ++exit: ++ udev_device_unref(udev_dev); ++ udev_unref(udev); ++ return rc; + } + diff --git a/mirrors b/mirrors new file mode 100644 index 0000000..74b0af6 --- /dev/null +++ b/mirrors @@ -0,0 +1 @@ +ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/ diff --git a/sources b/sources index 28f0c54..433028f 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -b9b6de70e26abb02c026296e9fbea25b pam_console_setowner-1.4.tgz -8a248b0c672e06b9c399c6e31471c922 udev-039.tar.gz +b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2 diff --git a/start_udev b/start_udev index 245ab6a..d90d6d0 100755 --- a/start_udev +++ b/start_udev @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # start_udev # @@ -24,19 +24,74 @@ sysfs_dir=/sys +export TZ=/etc/localtime + [ -d $sysfs_dir/class ] || exit 1 [ -r /proc/mounts ] || exit 1 -[ -x /sbin/udev ] || exit 1 +[ -x /sbin/udevd ] || exit 1 [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +udev_root=${udev_root-/dev} +if [ -f /dev/.in_sysinit ]; then + exec >/dev/console 2>/dev/console /dev/null 2>&1 || : - fi -} + USE_MD5="false" + [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" -# we cannot use /usr/bin/find here -find_d () { - where=$1 - what=$2 - found="" - for f in $where/*; do - if [ -d "$f" -a ! -L "$f" ]; then - if [ "$f" != "${f%%$what}" ];then - # make sure we are at the path end - # we have no dirname and basename - rest="${f#*$what}" - [ "${rest##*/}" = "$rest" ] && found="$found $f" + for i in 0 1 2 3 4 5 6 7; do + [ -b /dev/loop$i ] || /bin/mknod -m 0640 /dev/loop$i b 7 $i + /bin/chown root:disk /dev/loop$i + done + + for i in 0 1 2 3; do + [ -c /dev/lp$i ] || /bin/mknod -m 0660 /dev/lp$i c 6 $i + /bin/chown root:lp /dev/lp$i + done + + [ -d /dev/net ] || mkdir -p /dev/net + [ -c /dev/net/tun ] || /bin/mknod -m 0666 /dev/net/tun c 10 200 + #/bin/chown root:root /dev/net/tun + + [ -c /dev/ppp ] || /bin/mknod -m 0600 /dev/ppp c 108 0 + #/bin/chown root:root /dev/ppp + + [ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229 + #/bin/chown root:root /dev/fuse + + if [ -x /sbin/restorecon ]; then + /sbin/restorecon -R /dev + fi + + if [ -x "$MAKEDEV" ]; then + for i in /etc/udev/makedev.d/*.nodes; do + if [ -f "$i" ]; then + # use a little caching to speedup things + if [ "$USE_MD5" == "true" ]; then + # fix for MAKEDEV shell scripts + [ -d /dev/.udev/makedev.d ] || mkdir -p /dev/.udev/makedev.d + md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))-se$SELINUX_STATE + if [ -f "/var/lib/udev/makedev.d/${md5}.sh" ];then + md5file="/var/lib/udev/makedev.d/${md5}.sh" + else + md5file="/dev/.udev/makedev.d/${md5}.sh" + fi + if [ ! -f "$md5file" ]; then + ( sed -e 's,#.*,,g' "$i" | \ + xargs_simple -n 100 $MAKEDEV -x -a -S ) \ + > "$md5file" + fi + . "$md5file" >$udev_root/null 2>&1 + else + ( sed -e 's,#.*,,g' "$i" | \ + xargs_simple -n 100 $MAKEDEV -x ) + fi fi - found="$found $(find_d $f $what)" - fi - done - echo "$found" -} + done + fi -# we cannot use /usr/bin/find here -find_f () { - where=$1 - what=$2 - found="" - for f in $where/*; do - if [ -d "$f" -a ! -L "$f" ]; then - found="$found $(find_f $f $what)" - elif [ -e "$f" ]; then - [ "$f" != "${f%$what}" ] && found="$found $f" + for devdir in /etc/udev/devices /lib/udev/devices; do + [ -d "$devdir" ] || continue + pushd $devdir &> "$udev_root/null" + set * + if [ "$1" != "*" ]; then + #echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/." + cp -ar "$@" $udev_root/ + pushd "$udev_root" &> "$udev_root/null" + [ -x /sbin/restorecon ] && /sbin/restorecon "$@" + popd &> "$udev_root/null" fi + popd &> "$udev_root/null" done - echo "$found" } kill_udevd() { @@ -103,83 +180,155 @@ kill_udevd() { fi } - -# call hotplug with the scsi devices -scsi_replay () { - HOTPLUG=$(cat /proc/sys/kernel/hotplug) - [ -z "$HOTPLUG" ] && return 1 - - scsi_hosts=$(find_d /sys/devices host\*) - SEQNUM=1 - - for host in $scsi_hosts;do - [ -d $host ] || continue - devs=$(find_f $host type) - for dev in $devs;do - [ -f $dev ] || continue - export SEQNUM - DEVPATH=${dev%/type} - DEVPATH=${DEVPATH#/sys} - export DEVPATH - export ACTION=add - $HOTPLUG scsi_device - SEQNUM=$[$SEQNUM + 1] - $HOTPLUG scsi - SEQNUM=$[$SEQNUM + 1] - done - done - return 0 +findalias () { + local n + for n in "$1"/* ; do + [ -h "$n" ] && continue + [ -d "$n" ] && { findalias "$n" ; continue; } + [ "${n##*/}" == "modalias" ] && echo $(cat $n) + done } -ide_scan() { - if [ ! -d /proc/ide ]; then - return 1 - fi - for i in /proc/ide/*/media; do - read media < "$i" - case "$media" in - disk) - module=ide-disk - ;; - cdrom) - module=ide-cd - ;; - tape) - module=ide-tape - ;; - floppy) - module=ide-floppy - ;; - *) - module=ide-generic - ;; - esac - /sbin/modprobe $module +# returns OK if $1 contains $2 +strstr() { + [ "${1#*$2*}" = "$1" ] && return 1 + return 0 +} + +getval() { + what=$1 + shift + for arg; do + if strstr "$arg" "$what="; then + val=${arg#${what}=*} + echo $val + return 0 + fi done - return 0 + return 1 } +wait_for_queue() { + local timeout=${1:-0} + local ret=0 + if [ $timeout -gt 0 ]; then + /sbin/udevadm settle --timeout=$timeout + else + /sbin/udevadm settle + fi + ret=$? + if [ $ret -ne 0 ]; then + echo -n "Wait timeout. Will continue in the background." + fi + return $ret; +} export ACTION=add -export UDEV_NO_SLEEP=1 prog=udev ret=0 STRING=$"Starting $prog: " # propagate $udev_root from /sys -echo -n "$STRING " -grep -q "none ${udev_root%/} " /proc/mounts || { - mount -n -o mode=0755 -t tmpfs none "$udev_root" +echo -n "$STRING" + +# mount the tmpfs on ${udev_root%/}, if not already done +LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && { + if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then + PTSDIR=$(mktemp -d) + mount --move $udev_root/pts "$PTSDIR" + fi + if LANG=C fgrep -q "none ${udev_root%/}/shm " /proc/mounts; then + SHMDIR=$(mktemp -d) + mount --move $udev_root/shm "$SHMDIR" + fi + # First try to mount a devtmpfs on $udev_root + mount -n -o mode=0755 -t devtmpfs none "$udev_root" 2>/dev/null \ + || mount -n -o mode=0755 -t tmpfs none "$udev_root" + mkdir -m 0755 $udev_root/pts + mkdir -m 0755 $udev_root/shm + if [ -n "$PTSDIR" ]; then + mount --move "$PTSDIR" $udev_root/pts + rmdir "$PTSDIR" + fi + if [ -n "$SHMDIR" ]; then + mount --move "$SHMDIR" $udev_root/shm + rmdir "$SHMDIR" + fi + ret=$[$ret + $?] } -rm -f $udev_root/.udev.tdb -make_extra_nodes -kill_udevd >/dev/null 2>&1 -scsi_replay >/dev/null 2>&1 -ret=$[$ret + $?] -kill_udevd >/dev/null 2>&1 -ide_scan >/dev/null 2>&1 -/sbin/udevstart /dev/null 2>&1 -ret=$[$ret + $?] + +make_extra_nodes +cmdline=$(cat /proc/cmdline) +kill_udevd > "$udev_root/null" 2>&1 +rm -fr $udev_root/.udev > "$udev_root/null" 2>&1 +mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1 +UDEV_OPTS="" +if [ -f "/sys/class/tty/console/uevent" ]; then + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + + if strstr "$cmdline" udevtrace; then + UDEV_OPTS="$UDEV_OPTS --debug-trace" + fi + + if strstr "$cmdline" udevlog; then + UDEV_OPTS="$UDEV_OPTS --debug" + /sbin/udevd -d $UDEV_OPTS 2>$udev_root/.udev/udev.log + else + /sbin/udevd -d $UDEV_OPTS + fi + + wait + ret=$[$ret + $?] + + udevtimeout=$(getval udevtimeout $cmdline) + + if strstr "$cmdline" udevdebug; then + /sbin/udevadm control --log-priority=debug + fi + if strstr "$cmdline" udevinfo; then + /sbin/udevadm control --log-priority=info + fi + if strstr "$cmdline" udevchilds; then + /sbin/udevadm control --max-childs=$(getval udevchilds $cmdline) + fi + + /sbin/udevadm control --env=STARTUP=1 + + if strstr "$cmdline" modprobedebug; then + /sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q" + echo + findalias /sys | while read modules ; do + if [ -n "$modules" ]; then + echo "Loading modules for $modules in 5 seconds" + sleep 5 + /sbin/modprobe -a -v -q $modules + wait_for_queue $udevtimeout + fi + done + echo "Triggering Rest" + fi + + /sbin/udevadm trigger + ret=$[$ret + $?] + wait_for_queue $udevtimeout + ret=$[$ret + $?] + wait + ret=$[$ret + $?] + /sbin/udevadm control --env=STARTUP= + # touch all device files for timezone glitches + # "find" is in /usr/bin and might not be available + if [ -f /etc/sysconfig/clock ]; then + . /etc/sysconfig/clock + [[ "$UTC" == "false" || "$UTC" == "no" ]] \ + && touch_recursive /dev > "$udev_root/null" 2>&1 + fi +else + echo -n " kernel too old for this udev version " + /sbin/udevd -d $UDEV_OPTS + ret=10 +fi + [ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING" echo exit 0 diff --git a/udev-141-cpu-online.patch b/udev-141-cpu-online.patch new file mode 100644 index 0000000..909e6e5 --- /dev/null +++ b/udev-141-cpu-online.patch @@ -0,0 +1,8 @@ +--- udev-141/rules/redhat/40-redhat.rules 2008-10-16 11:03:43.000000000 -0500 ++++ udev-141.cpu/rules/redhat/40-redhat.rules 2009-05-20 11:23:12.000000000 -0500 +@@ -25,3 +25,5 @@ + KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" + + KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse" ++ ++ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'" diff --git a/udev-145-cdrom_id-backport.patch b/udev-145-cdrom_id-backport.patch new file mode 100644 index 0000000..baa5d8a --- /dev/null +++ b/udev-145-cdrom_id-backport.patch @@ -0,0 +1,298 @@ +diff -urN udev-145-orig/extras/cdrom_id/60-cdrom_id.rules udev-145/extras/cdrom_id/60-cdrom_id.rules +--- udev-145-orig/extras/cdrom_id/60-cdrom_id.rules 2010-09-21 12:05:03.025750002 +0200 ++++ udev-145/extras/cdrom_id/60-cdrom_id.rules 2010-06-11 10:52:56.000000000 +0200 +@@ -1,7 +1,6 @@ + # do not edit this file, it will be overwritten on update + +-# import optical drive properties +-ACTION!="add|change", GOTO="cdrom_end" ++ACTION=="remove", GOTO="cdrom_end" + SUBSYSTEM!="block", GOTO="cdrom_end" + KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end" + ENV{DEVTYPE}!="disk", GOTO="cdrom_end" +Binary files udev-145-orig/extras/cdrom_id/cdrom_id and udev-145/extras/cdrom_id/cdrom_id differ +diff -urN udev-145-orig/extras/cdrom_id/cdrom_id.c udev-145/extras/cdrom_id/cdrom_id.c +--- udev-145-orig/extras/cdrom_id/cdrom_id.c 2010-09-21 12:05:03.024750002 +0200 ++++ udev-145/extras/cdrom_id/cdrom_id.c 2010-08-31 10:35:41.000000000 +0200 +@@ -85,6 +85,8 @@ + static unsigned int cd_media_dvd_rom = 0; + static unsigned int cd_media_dvd_r = 0; + static unsigned int cd_media_dvd_rw = 0; ++static unsigned int cd_media_dvd_rw_ro = 0; /* restricted overwrite mode */ ++static unsigned int cd_media_dvd_rw_seq = 0; /* sequential mode */ + static unsigned int cd_media_dvd_ram = 0; + static unsigned int cd_media_dvd_plus_r = 0; + static unsigned int cd_media_dvd_plus_rw = 0; +@@ -200,27 +202,27 @@ + + static int cd_capability_compat(struct udev *udev, int fd) + { +- int capabilty; ++ int capability; + +- capabilty = ioctl(fd, CDROM_GET_CAPABILITY, NULL); +- if (capabilty < 0) { ++ capability = ioctl(fd, CDROM_GET_CAPABILITY, NULL); ++ if (capability < 0) { + info(udev, "CDROM_GET_CAPABILITY failed\n"); + return -1; + } + +- if (capabilty & CDC_CD_R) ++ if (capability & CDC_CD_R) + cd_cd_r = 1; +- if (capabilty & CDC_CD_RW) ++ if (capability & CDC_CD_RW) + cd_cd_rw = 1; +- if (capabilty & CDC_DVD) ++ if (capability & CDC_DVD) + cd_dvd_rom = 1; +- if (capabilty & CDC_DVD_R) ++ if (capability & CDC_DVD_R) + cd_dvd_r = 1; +- if (capabilty & CDC_DVD_RAM) ++ if (capability & CDC_DVD_RAM) + cd_dvd_ram = 1; +- if (capabilty & CDC_MRW) ++ if (capability & CDC_MRW) + cd_mrw = 1; +- if (capabilty & CDC_MRW_W) ++ if (capability & CDC_MRW_W) + cd_mrw_w = 1; + return 0; + } +@@ -348,6 +350,39 @@ + return 0; + } + ++static int cd_profiles_old_mmc(struct udev *udev, int fd) ++{ ++ struct scsi_cmd sc; ++ int err; ++ ++ unsigned char header[32]; ++ ++ scsi_cmd_init(udev, &sc, header, sizeof(header)); ++ scsi_cmd_set(udev, &sc, 0, 0x51); ++ scsi_cmd_set(udev, &sc, 8, sizeof(header)); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header)); ++ if ((err != 0)) { ++ info_scsi_cmd_err(udev, "READ DISC INFORMATION", err); ++ info(udev, "no current profile, assuming no media\n"); ++ return -1; ++ }; ++ ++ cd_media = 1; ++ ++ if (header[2] & 16) { ++ cd_media_cd_rw = 1; ++ info(udev, "profile 0x0a media_cd_rw\n"); ++ } else if ((header[2] & 3) < 2 && cd_cd_r) { ++ cd_media_cd_r = 1; ++ info(udev, "profile 0x09 media_cd_r\n"); ++ } else { ++ cd_media_cd_rom = 1; ++ info(udev, "profile 0x08 media_cd_rom\n"); ++ } ++ return 0; ++} ++ + static int cd_profiles(struct udev *udev, int fd) + { + struct scsi_cmd sc; +@@ -365,6 +400,12 @@ + err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features)); + if ((err != 0)) { + info_scsi_cmd_err(udev, "GET CONFIGURATION", err); ++ /* handle pre-MMC2 drives which do not support GET CONFIGURATION */ ++ if (SK(err) == 0x5 && ASC(err) == 0x20) { ++ info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n"); ++ info(udev, "trying to work around the problem\n"); ++ return cd_profiles_old_mmc(udev, fd); ++ } + return -1; + } + +@@ -440,10 +481,16 @@ + cd_media_dvd_ram = 1; + break; + case 0x13: ++ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile); ++ cd_media = 1; ++ cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_ro = 1; ++ break; + case 0x14: +- info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile); ++ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile); + cd_media = 1; + cd_media_dvd_rw = 1; ++ cd_media_dvd_rw_seq = 1; + break; + case 0x1B: + info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile); +@@ -527,12 +574,126 @@ + + cd_media = 1; + info(udev, "disk type %02x\n", header[8]); ++ info(udev, "hardware reported media status: %s\n", media_status[header[2] & 3]); + + /* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */ + if (!cd_media_cd_rom) + cd_media_state = media_status[header[2] & 3]; + +- if ((header[2] & 3) != 2) ++ /* fresh DVD-RW in restricted overwite mode reports itself as ++ * "appendable"; change it to "blank" to make it consistent with what ++ * gets reported after blanking, and what userspace expects */ ++ if (cd_media_dvd_rw_ro && (header[2] & 3) == 1) ++ cd_media_state = media_status[0]; ++ ++ /* DVD+RW discs (and DVD-RW in restricted mode) once formatted are ++ * always "complete", DVD-RAM are "other" or "complete" if the disc is ++ * write protected; we need to check the contents if it is blank */ ++ if ((cd_media_dvd_rw_ro || cd_media_dvd_plus_rw || cd_media_dvd_plus_rw_dl || cd_media_dvd_ram) && (header[2] & 3) > 1) { ++ unsigned char buffer[32 * 2048]; ++ unsigned char result, len; ++ int block, offset; ++ ++ if (cd_media_dvd_ram) { ++ /* a write protected dvd-ram may report "complete" status */ ++ ++ unsigned char dvdstruct[8]; ++ unsigned char format[12]; ++ ++ scsi_cmd_init(udev, &sc, dvdstruct, sizeof(dvdstruct)); ++ scsi_cmd_set(udev, &sc, 0, 0xAD); ++ scsi_cmd_set(udev, &sc, 7, 0xC0); ++ scsi_cmd_set(udev, &sc, 9, sizeof(dvdstruct)); ++ scsi_cmd_set(udev, &sc, 11, 0); ++ err = scsi_cmd_run(udev, &sc, fd, dvdstruct, sizeof(dvdstruct)); ++ if ((err != 0)) { ++ info_scsi_cmd_err(udev, "READ DVD STRUCTURE", err); ++ return -1; ++ } ++ if (dvdstruct[4] & 0x02) { ++ cd_media_state = media_status[2]; ++ info(udev, "write-protected DVD-RAM media inserted\n"); ++ goto determined; ++ } ++ ++ /* let's make sure we don't try to read unformatted media */ ++ scsi_cmd_init(udev, &sc, format, sizeof(format)); ++ scsi_cmd_set(udev, &sc, 0, 0x23); ++ scsi_cmd_set(udev, &sc, 8, sizeof(format)); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, format, sizeof(format)); ++ if ((err != 0)) { ++ info_scsi_cmd_err(udev, "READ DVD FORMAT CAPACITIES", err); ++ return -1; ++ } ++ ++ len = format[3]; ++ if (len & 7 || len < 16) { ++ info(udev, "invalid format capacities length\n"); ++ return -1; ++ } ++ ++ switch(format[8] & 3) { ++ case 1: ++ info(udev, "unformatted DVD-RAM media inserted\n"); ++ /* This means that last format was interrupted ++ * or failed, blank dvd-ram discs are factory ++ * formatted. Take no action here as it takes ++ * quite a while to reformat a dvd-ram and it's ++ * not automatically started */ ++ goto determined; ++ ++ case 2: ++ info(udev, "formatted DVD-RAM media inserted\n"); ++ break; ++ ++ case 3: ++ cd_media = 0; //return no media ++ info(udev, "format capacities returned no media\n"); ++ return -1; ++ } ++ } ++ ++ /* Take a closer look at formatted media (unformatted DVD+RW ++ * has "blank" status", DVD-RAM was examined earlier) and check ++ * for ISO and UDF PVDs or a fs superblock presence and do it ++ * in one ioctl (we need just sectors 0 and 16) */ ++ scsi_cmd_init(udev, &sc, buffer, sizeof(buffer)); ++ scsi_cmd_set(udev, &sc, 0, 0x28); ++ scsi_cmd_set(udev, &sc, 5, 0); ++ scsi_cmd_set(udev, &sc, 8, 32); ++ scsi_cmd_set(udev, &sc, 9, 0); ++ err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer)); ++ if ((err != 0)) { ++ info_scsi_cmd_err(udev, "READ FIRST 32 BLOCKS", err); ++ return -1; ++ } ++ ++ /* if any non-zero data is found in sector 16 (iso and udf) or ++ * eventually 0 (fat32 boot sector, ext2 superblock, etc), disc ++ * is assumed non-blank */ ++ result = 0; ++ ++ for (block = 32768; block >= 0 && !result; block -= 32768) { ++ offset = block; ++ while (offset < (block + 2048) && !result) { ++ result = buffer [offset]; ++ offset++; ++ } ++ } ++ ++ if (!result) { ++ cd_media_state = media_status[0]; ++ info(udev, "no data in blocks 0 or 16, assuming blank\n"); ++ } else { ++ info(udev, "data in blocks 0 or 16, assuming complete\n"); ++ } ++ } ++ ++determined: ++ /* "other" is e. g. DVD-RAM, can't append sessions there; DVDs in ++ * restricted overwrite mode can never append, only in sequential mode */ ++ if ((header[2] & 3) < 2 && !cd_media_dvd_rw_ro) + cd_media_session_next = header[10] << 8 | header[5]; + cd_media_session_count = header[9] << 8 | header[4]; + cd_media_track_count = header[11] << 8 | header[6]; +@@ -710,13 +871,11 @@ + if (cd_profiles(udev, fd) < 0) + goto print; + +- /* get writable media state */ +- if (cd_media_info(udev, fd) < 0) +- goto print; +- + /* get session/track info */ +- if (cd_media_toc(udev, fd) < 0) +- goto print; ++ cd_media_toc(udev, fd); ++ ++ /* get writable media state */ ++ cd_media_info(udev, fd); + + print: + printf("ID_CDROM=1\n"); +@@ -810,14 +969,14 @@ + printf("ID_CDROM_MEDIA_SESSION_NEXT=%d\n", cd_media_session_next); + if (cd_media_session_count > 0) + printf("ID_CDROM_MEDIA_SESSION_COUNT=%d\n", cd_media_session_count); ++ if (cd_media_session_count > 1 && cd_media_session_last_offset > 0) ++ printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset); + if (cd_media_track_count > 0) + printf("ID_CDROM_MEDIA_TRACK_COUNT=%d\n", cd_media_track_count); + if (cd_media_track_count_audio > 0) + printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%d\n", cd_media_track_count_audio); + if (cd_media_track_count_data > 0) + printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%d\n", cd_media_track_count_data); +- if (cd_media_session_last_offset > 0) +- printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset); + exit: + if (fd >= 0) + close(fd); + diff --git a/udev-145-floppy.patch b/udev-145-floppy.patch new file mode 100644 index 0000000..1d5c45b --- /dev/null +++ b/udev-145-floppy.patch @@ -0,0 +1,14 @@ +diff -up udev-145/rules/rules.d/50-udev-default.rules.floppy udev-145/rules/rules.d/50-udev-default.rules +--- udev-145/rules/rules.d/50-udev-default.rules.floppy 2010-09-21 12:16:36.562750009 +0200 ++++ udev-145/rules/rules.d/50-udev-default.rules 2010-09-21 12:17:48.201750065 +0200 +@@ -69,7 +69,9 @@ SUBSYSTEM=="block", GROUP="disk" + + # floppy + KERNEL=="fd[0-9]", GROUP="floppy" +-KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k" ++KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", ENV{CMOS_TYPE}="$attr{cmos}", \ ++ RUN+="create_floppy_devices -c -t $env{CMOS_TYPE} -m %M -M 0640 -G floppy $root/%k" ++ + KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions" + + # cdrom diff --git a/udev-145-hid2hci-backport.patch b/udev-145-hid2hci-backport.patch new file mode 100644 index 0000000..c24df50 --- /dev/null +++ b/udev-145-hid2hci-backport.patch @@ -0,0 +1,638 @@ +diff -upr udev-145.old/extras/hid2hci/70-hid2hci.rules udev-145/extras/hid2hci/70-hid2hci.rules +--- udev-145.old/extras/hid2hci/70-hid2hci.rules 2009-06-28 01:07:53.000000000 +0100 ++++ udev-145/extras/hid2hci/70-hid2hci.rules 2009-11-05 00:00:29.000000000 +0000 +@@ -1,25 +1,28 @@ + # do not edit this file, it will be overwritten on update + +-ACTION!="add", GOTO="hid2hci_end" ++ACTION!="add|change", GOTO="hid2hci_end" + SUBSYSTEM!="usb", GOTO="hid2hci_end" + +-# Variety of Dell Bluetooth devices - it looks like a bit of an odd rule, +-# because it is matching on a mouse device that is self powered, but that +-# is where a HID report needs to be sent to switch modes. +-# ++# Variety of Dell Bluetooth devices - match on a mouse device that is ++# self powered and where a HID report needs to be sent to switch modes + # Known supported devices: 413c:8154, 413c:8158, 413c:8162 +-ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ +- RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci" ++ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", \ ++ ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \ ++ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1" ++ ++# Logitech devices (hidraw) ++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \ ++ RUN+="hid2hci --method=logitech-hid --devpath=%p" + + ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end" + +-# Logitech devices +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci" +- +-# CSR devices (in HID mode) +-ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" +-ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci" ++# When a Dell device recovers from S3, the mouse child needs to be repoked ++# Unfortunately the only event seen is the BT device disappearing, so the mouse ++# device needs to be chased down on the USB bus. ++ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \ ++ ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1" ++ ++# CSR devices ++ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p" + + LABEL="hid2hci_end" +diff -upr udev-145.old/extras/hid2hci/hid2hci.c udev-145/extras/hid2hci/hid2hci.c +--- udev-145.old/extras/hid2hci/hid2hci.c 2009-06-13 01:55:10.000000000 +0100 ++++ udev-145/extras/hid2hci/hid2hci.c 2009-11-05 00:00:24.000000000 +0000 +@@ -1,31 +1,26 @@ + /* ++ * hid2hci : switch the radio on devices that support ++ * it from HID to HCI and back + * +- * hid2hci : a tool for switching the radio on devices that support +- * it from HID to HCI and back ++ * Copyright (C) 2003-2009 Marcel Holtmann ++ * Copyright (C) 2008-2009 Mario Limonciello ++ * Copyright (C) 2009 Kay Sievers + * +- * Copyright (C) 2003-2009 Marcel Holtmann +- * Copyright (C) 2008-2009 Mario Limonciello ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. + * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, write to the Free Software +- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. + * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#ifdef HAVE_CONFIG_H +-#include +-#endif +- + #include + #include + #include +@@ -33,79 +28,24 @@ + #include + #include + #include +- ++#include + #include + +-#ifdef NEED_USB_GET_BUSSES +-static inline struct usb_bus *usb_get_busses(void) +-{ +- return usb_busses; +-} +-#endif +- +-#ifndef USB_DIR_OUT +-#define USB_DIR_OUT 0x00 +-#endif +- +-static char devpath[PATH_MAX + 1] = "/dev"; +- +-struct hiddev_devinfo { +- unsigned int bustype; +- unsigned int busnum; +- unsigned int devnum; +- unsigned int ifnum; +- short vendor; +- short product; +- short version; +- unsigned num_applications; +-}; +- +-struct hiddev_report_info { +- unsigned report_type; +- unsigned report_id; +- unsigned num_fields; +-}; +- +-typedef __signed__ int __s32; ++#include "libudev.h" ++#include "libudev-private.h" + +-struct hiddev_usage_ref { +- unsigned report_type; +- unsigned report_id; +- unsigned field_index; +- unsigned usage_index; +- unsigned usage_code; +- __s32 value; ++enum mode { ++ HCI = 0, ++ HID = 1, + }; + +-#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo) +-#define HIDIOCINITREPORT _IO('H', 0x05) +-#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info) +-#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref) +- +-#define HID_REPORT_TYPE_OUTPUT 2 +- +-#define HCI 0 +-#define HID 1 +- +-struct device_info { +- struct usb_device *dev; +- int mode; +- uint16_t vendor; +- uint16_t product; +-}; +- +-static int switch_csr(struct device_info *devinfo) ++static int usb_switch_csr(struct usb_dev_handle *dev, enum mode mode) + { +- struct usb_dev_handle *udev; + int err; + +- udev = usb_open(devinfo->dev); +- if (!udev) +- return -errno; +- +- err = usb_control_msg(udev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, +- 0, devinfo->mode, 0, NULL, 0, 10000); +- ++ err = usb_control_msg(dev, ++ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, ++ 0, mode, 0, NULL, 0, 10000); + if (err == 0) { + err = -1; + errno = EALREADY; +@@ -113,13 +53,10 @@ static int switch_csr(struct device_info + if (errno == ETIMEDOUT) + err = 0; + } +- +- usb_close(udev); +- + return err; + } + +-static int send_report(int fd, const char *buf, size_t size) ++static int hid_logitech_send_report(int fd, const char *buf, size_t size) + { + struct hiddev_report_info rinfo; + struct hiddev_usage_ref uref; +@@ -148,72 +85,42 @@ static int send_report(int fd, const cha + return err; + } + +-static int switch_logitech(struct device_info *devinfo) ++static int hid_switch_logitech(const char *filename) + { +- char devname[PATH_MAX + 1]; +- int i, fd, err = -1; +- +- for (i = 0; i < 16; i++) { +- struct hiddev_devinfo dinfo; +- char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 }; +- char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 }; +- char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 }; +- +- sprintf(devname, "%s/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) { +- sprintf(devname, "%s/usb/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) { +- sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i); +- fd = open(devname, O_RDWR); +- if (fd < 0) +- continue; +- } +- } +- +- memset(&dinfo, 0, sizeof(dinfo)); +- err = ioctl(fd, HIDIOCGDEVINFO, &dinfo); +- if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) || +- (int) dinfo.devnum != atoi(devinfo->dev->filename)) { +- close(fd); +- continue; +- } +- +- err = ioctl(fd, HIDIOCINITREPORT, 0); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep1, sizeof(rep1)); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep2, sizeof(rep2)); +- if (err < 0) { +- close(fd); +- break; +- } +- +- err = send_report(fd, rep3, sizeof(rep3)); +- close(fd); +- break; +- } +- ++ char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 }; ++ char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 }; ++ char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 }; ++ int fd; ++ int err = -1; ++ ++ fd = open(filename, O_RDWR); ++ if (fd < 0) ++ return err; ++ ++ err = ioctl(fd, HIDIOCINITREPORT, 0); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep1, sizeof(rep1)); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep2, sizeof(rep2)); ++ if (err < 0) ++ goto out; ++ ++ err = hid_logitech_send_report(fd, rep3, sizeof(rep3)); ++out: ++ close(fd); + return err; + } + +-static int switch_dell(struct device_info *devinfo) ++static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode) + { + char report[] = { 0x7f, 0x00, 0x00, 0x00 }; +- +- struct usb_dev_handle *handle; + int err; + +- switch (devinfo->mode) { ++ switch (mode) { + case HCI: + report[1] = 0x13; + break; +@@ -222,22 +129,16 @@ static int switch_dell(struct device_inf + break; + } + +- handle = usb_open(devinfo->dev); +- if (!handle) +- return -EIO; +- + /* Don't need to check return, as might not be in use */ +- usb_detach_kernel_driver_np(handle, 0); ++ usb_detach_kernel_driver_np(dev, 0); + +- if (usb_claim_interface(handle, 0) < 0) { +- usb_close(handle); ++ if (usb_claim_interface(dev, 0) < 0) + return -EIO; +- } + +- err = usb_control_msg(handle, +- USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, ++ err = usb_control_msg(dev, ++ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0, +- report, sizeof(report), 5000); ++ report, sizeof(report), 5000); + + if (err == 0) { + err = -1; +@@ -246,131 +147,203 @@ static int switch_dell(struct device_inf + if (errno == ETIMEDOUT) + err = 0; + } +- +- usb_close(handle); +- + return err; + } + +-static int find_device(struct device_info* devinfo) ++/* ++ * The braindead libusb needs to scan and open all devices, just to ++ * to find the device we already have. This needs to be fixed in libusb ++ * or it will be ripped out and we carry our own code. ++ */ ++static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev) + { + struct usb_bus *bus; +- struct usb_device *dev; ++ const char *str; ++ int busnum; ++ int devnum; ++ ++ str = udev_device_get_sysattr_value(usb_dev, "busnum"); ++ if (str == NULL) ++ return NULL; ++ busnum = strtol(str, NULL, 0); ++ ++ str = udev_device_get_sysattr_value(usb_dev, "devnum"); ++ if (str == NULL) ++ return NULL; ++ devnum = strtol(str, NULL, 0); + ++ usb_init(); + usb_find_busses(); + usb_find_devices(); + +- for (bus = usb_get_busses(); bus; bus = bus->next) ++ for (bus = usb_get_busses(); bus; bus = bus->next) { ++ struct usb_device *dev; ++ ++ if (strtol(bus->dirname, NULL, 10) != busnum) ++ continue; ++ + for (dev = bus->devices; dev; dev = dev->next) { +- if (dev->descriptor.idVendor == devinfo->vendor && +- dev->descriptor.idProduct == devinfo->product) { +- devinfo->dev=dev; +- return 1; +- } ++ if (dev->devnum == devnum) ++ return dev; + } +- return 0; ++ } ++ ++ return NULL; ++} ++ ++static struct usb_dev_handle *find_device(struct udev_device *udev_dev) ++{ ++ struct usb_device *dev; ++ ++ dev = usb_device_open_from_udev(udev_dev); ++ if (dev == NULL) ++ return NULL; ++ return usb_open(dev); + } + +-static void usage(char* error) ++static void usage(const char *error) + { + if (error) + fprintf(stderr,"\n%s\n", error); + else + printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n"); + +- printf("Usage:\n" +- "\thid2hci [options]\n" +- "\n"); +- +- printf("Options:\n" +- "\t-h, --help Display help\n" +- "\t-q, --quiet Don't display any messages\n" +- "\t-r, --mode= Mode to switch to [hid, hci]\n" +- "\t-v, --vendor= Vendor ID to act upon\n" +- "\t-p, --product= Product ID to act upon\n" +- "\t-m, --method= Method to use to switch [csr, logitech, dell]\n" +- "\n"); +- if (error) +- exit(1); ++ printf("Usage: hid2hci [options]\n" ++ " --mode= mode to switch to [hid|hci] (default hci)\n" ++ " --devpath= sys device path\n" ++ " --method= method to use to switch [csr|logitech-hid|dell]\n" ++ " --help\n\n"); + } + +-static const struct option main_options[] = { +- { "help", no_argument, 0, 'h' }, +- { "quiet", no_argument, 0, 'q' }, +- { "mode", required_argument, 0, 'r' }, +- { "vendor", required_argument, 0, 'v' }, +- { "product", required_argument, 0, 'p' }, +- { "method", required_argument, 0, 'm' }, +- { 0, 0, 0, 0 } +-}; +- + int main(int argc, char *argv[]) + { +- struct device_info dev = { NULL, HCI, 0, 0 }; +- int opt, quiet = 0; +- int (*method)(struct device_info *dev) = NULL; +- +- while ((opt = getopt_long(argc, argv, "+r:v:p:m:qh", main_options, NULL)) != -1) { +- switch (opt) { +- case 'r': +- if (optarg && !strcmp(optarg, "hid")) +- dev.mode = HID; +- else if (optarg && !strcmp(optarg, "hci")) +- dev.mode = HCI; +- else +- usage("ERROR: Undefined radio mode\n"); ++ static const struct option options[] = { ++ { "help", no_argument, NULL, 'h' }, ++ { "mode", required_argument, NULL, 'm' }, ++ { "devpath", required_argument, NULL, 'p' }, ++ { "method", required_argument, NULL, 'M' }, ++ { } ++ }; ++ enum method { ++ METHOD_UNDEF, ++ METHOD_CSR, ++ METHOD_LOGITECH_HID, ++ METHOD_DELL, ++ } method = METHOD_UNDEF; ++ struct udev *udev; ++ struct udev_device *udev_dev = NULL; ++ char syspath[UTIL_PATH_SIZE]; ++ int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL; ++ enum mode mode = HCI; ++ const char *devpath = NULL; ++ int err = -1; ++ int rc = 1; ++ ++ for (;;) { ++ int option; ++ ++ option = getopt_long(argc, argv, "m:p:M:qh", options, NULL); ++ if (option == -1) + break; +- case 'v': +- sscanf(optarg, "%4hx", &dev.vendor); ++ ++ switch (option) { ++ case 'm': ++ if (!strcmp(optarg, "hid")) { ++ mode = HID; ++ } else if (!strcmp(optarg, "hci")) { ++ mode = HCI; ++ } else { ++ usage("error: undefined radio mode\n"); ++ exit(1); ++ } + break; + case 'p': +- sscanf(optarg, "%4hx", &dev.product); +- break; +- case 'm': +- if (optarg && !strcmp(optarg, "csr")) +- method = switch_csr; +- else if (optarg && !strcmp(optarg, "logitech")) +- method = switch_logitech; +- else if (optarg && !strcmp(optarg, "dell")) +- method = switch_dell; +- else +- usage("ERROR: Undefined switching method\n"); ++ devpath = optarg; + break; +- case 'q': +- quiet = 1; ++ case 'M': ++ if (!strcmp(optarg, "csr")) { ++ method = METHOD_CSR; ++ usb_switch = usb_switch_csr; ++ } else if (!strcmp(optarg, "logitech-hid")) { ++ method = METHOD_LOGITECH_HID; ++ } else if (!strcmp(optarg, "dell")) { ++ method = METHOD_DELL; ++ usb_switch = usb_switch_dell; ++ } else { ++ usage("error: undefined switching method\n"); ++ exit(1); ++ } + break; + case 'h': + usage(NULL); + default: +- exit(0); ++ exit(1); + } + } + +- if (!quiet && (!dev.vendor || !dev.product || !method)) +- usage("ERROR: Vendor ID, Product ID, and Switching Method must all be defined.\n"); ++ if (!devpath || method == METHOD_UNDEF) { ++ usage("error: --devpath= and --method= must be defined\n"); ++ exit(1); ++ } + +- argc -= optind; +- argv += optind; +- optind = 0; ++ udev = udev_new(); ++ if (udev == NULL) ++ goto exit; ++ ++ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL); ++ udev_dev = udev_device_new_from_syspath(udev, syspath); ++ if (udev_dev == NULL) { ++ fprintf(stderr, "error: could not find '%s'\n", devpath); ++ goto exit; ++ } + +- usb_init(); ++ switch (method) { ++ case METHOD_CSR: ++ case METHOD_DELL: { ++ struct udev_device *dev; ++ struct usb_dev_handle *handle; ++ const char *type; ++ ++ /* get the parent usb_device if needed */ ++ dev = udev_dev; ++ type = udev_device_get_devtype(dev); ++ if (type == NULL || strcmp(type, "usb_device") != 0) { ++ dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"); ++ if (dev == NULL) { ++ fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath); ++ goto exit; ++ } ++ } + +- if (!find_device(&dev)) { +- if (!quiet) +- fprintf(stderr, "Device %04x:%04x not found on USB bus.\n", +- dev.vendor, dev.product); +- exit(1); ++ handle = find_device(dev); ++ if (handle == NULL) { ++ fprintf(stderr, "error: unable to handle '%s'\n", ++ udev_device_get_syspath(dev)); ++ goto exit; ++ } ++ err = usb_switch(handle, mode); ++ break; + } ++ case METHOD_LOGITECH_HID: { ++ const char *device; + +- if (!quiet) +- printf("Attempting to switch device %04x:%04x to %s mode ", +- dev.vendor, dev.product, dev.mode ? "HID" : "HCI"); +- fflush(stdout); +- +- if (method(&dev) < 0 && !quiet) +- printf("failed (%s)\n", strerror(errno)); +- else if (!quiet) +- printf("was successful\n"); ++ device = udev_device_get_devnode(udev_dev); ++ if (device == NULL) { ++ fprintf(stderr, "error: could not find hiddev device node\n"); ++ goto exit; ++ } ++ err = hid_switch_logitech(device); ++ break; ++ } ++ default: ++ break; ++ } + +- return errno; ++ if (err < 0) ++ fprintf(stderr, "error: switching device '%s' failed.\n", ++ udev_device_get_syspath(udev_dev)); ++exit: ++ udev_device_unref(udev_dev); ++ udev_unref(udev); ++ return rc; + } +--- udev-145.old/extras/hid2hci/Makefile.am 2009-06-16 23:49:02.000000000 +0100 ++++ udev-145/extras/hid2hci/Makefile.am 2009-11-05 00:10:10.000000000 +0000 +@@ -10,4 +10,4 @@ hid2hci_SOURCES = \ + hid2hci.c + + hid2hci_LDADD = \ +- @LIBUSB_LIBS@ ++ @LIBUSB_LIBS@ $(top_builddir)/libudev/libudev.la +--- udev-145.old/libudev/exported_symbols 2009-05-21 21:16:39.000000000 +0100 ++++ udev-145/libudev/exported_symbols 2009-11-05 00:15:08.000000000 +0000 +@@ -71,3 +71,4 @@ udev_queue_get_seqnum_is_finished + udev_queue_get_seqnum_sequence_is_finished + udev_queue_get_queued_list_entry + udev_queue_get_failed_list_entry ++util_strscpyl diff --git a/udev-145-keymap-backport.patch b/udev-145-keymap-backport.patch new file mode 100644 index 0000000..dac4b04 --- /dev/null +++ b/udev-145-keymap-backport.patch @@ -0,0 +1,1026 @@ +diff -urN udev-145-orig/extras/keymap/95-keyboard-force-release.rules udev-145/extras/keymap/95-keyboard-force-release.rules +--- udev-145-orig/extras/keymap/95-keyboard-force-release.rules 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/95-keyboard-force-release.rules 2010-08-04 14:23:27.000000000 +0200 +@@ -0,0 +1,38 @@ ++# Set model specific atkbd force_release quirk ++# ++# Several laptops have hotkeys which don't generate release events, ++# which can cause problems with software key repeat. ++# The atkbd driver has a quirk handler for generating synthetic ++# release events, which can be configured via sysfs since 2.6.32. ++# Simply add a file with a list of scancodes for your laptop model ++# in /lib/udev/keymaps, and add a rule here. ++# If the hotkeys also need a keymap assignment you can copy the ++# scancodes from the keymap file, otherwise you can run ++# /lib/udev/keymap -i /dev/input/eventX ++# on a Linux vt to find out. ++ ++ACTION=="remove", GOTO="force_release_end" ++SUBSYSTEM!="serio", GOTO="force_release_end" ++KERNEL!="serio*", GOTO="force_release_end" ++DRIVER!="atkbd", GOTO="force_release_end" ++ ++ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" ++ ++ ++ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other" ++ ++ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="FOXCONN", ATTR{[dmi/id]product_name}=="QBOOK", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="MTC", ATTR{[dmi/id]product_version}=="A0", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite U300|Satellite Pro U300|Satellite U305", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys" ++ ++LABEL="force_release_end" +diff -urN udev-145-orig/extras/keymap/95-keymap.rules udev-145/extras/keymap/95-keymap.rules +--- udev-145-orig/extras/keymap/95-keymap.rules 2010-09-21 11:38:12.791750001 +0200 ++++ udev-145/extras/keymap/95-keymap.rules 2010-09-21 12:02:18.722750001 +0200 +@@ -1,22 +1,52 @@ +-ACTION!="add", GOTO="keyboard_end" ++# Set model specific hotkey keycodes. ++# ++# Key map overrides can be specified by either giving scancode/keyname pairs ++# directly as keymap arguments (if there are just one or two to change), or as ++# a file name (in /lib/udev/keymaps), which has to contain scancode/keyname ++# pairs. ++ ++ACTION=="remove", GOTO="keyboard_end" + SUBSYSTEM!="input", GOTO="keyboard_end" + KERNEL!="event*", GOTO="keyboard_end" + +-ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" +-ENV{DMI_VENDOR}=="", GOTO="keyboard_end" ++SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="", IMPORT{program}="usb_id --export %p" ++SUBSYSTEMS=="usb", GOTO="keyboard_usbcheck" ++GOTO="keyboard_modulecheck" ++ ++# ++# The following are external USB keyboards ++# ++ ++LABEL="keyboard_usbcheck" ++ ++ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Multimedia Keyboard", RUN+="keymap $name logitech-wave" ++ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-cordless" ++# Logitech Cordless Wave Pro looks slightly weird; some hotkeys are coming through the mouse interface ++ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c529", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-pro-cordless" ++ ++ENV{ID_VENDOR}=="Lite-On_Technology_Corp*", ATTRS{name}=="Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint", RUN+="keymap $name lenovo-thinkpad-usb-keyboard-trackpoint" ++ENV{ID_VENDOR_ID}=="04b3", ENV{ID_MODEL_ID}=="301[89]", RUN+="keymap $name ibm-thinkpad-usb-keyboard-trackpoint" ++ ++GOTO="keyboard_end" + + # + # The following are exposed as separate input devices with low key codes, thus + # we need to check their input device product name + # + ++LABEL="keyboard_modulecheck" ++ ++ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}" ++ENV{DMI_VENDOR}=="", GOTO="keyboard_end" ++ + ENV{DMI_VENDOR}=="IBM*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-ibm" + ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-lenovo" ++ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="Lenovo ThinkPad SL Series extra buttons", RUN+="keymap $name 0x0E bluetooth" + ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", ATTR{[dmi/id]product_name}=="W3J", RUN+="keymap $name module-asus-w3j" + ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony" + + # Older Vaios have some different keys +-ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*|*VGN-SZ2HP_B*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" ++ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old" + + # + # The following rules belong to standard i8042 AT keyboard with high key codes. +@@ -28,26 +58,41 @@ + LABEL="keyboard_vendorcheck" + + ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell" +-ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N610c*|*Evo N600c*", RUN+="keymap $name compaq-e_evo" ++ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 910|Inspiron 1010|Inspiron 1011|Inspiron 1012|Inspiron 1110|Inspiron 1210", RUN+="keymap $name 0x84 wlan" ++ ++ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo" + + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000" + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x6_tablet" + ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X200 Tablet*", ATTR{[dmi/id]product_version}=="* Tablet" RUN+="keymap $name lenovo-thinkpad_x200_tablet" ++ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*IdeaPad*", RUN+="keymap $name lenovo-ideapad" ++ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_name}=="S10-*", RUN+="keymap $name lenovo-ideapad" ++ENV{DMI_VENDOR}=="LENOVO", ATTR{[dmi/id]product_version}=="*IdeaPad Y550*", RUN+="keymap $name 0x95 media 0xA3 play" + + ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keymap $name hewlett-packard-pavilion" +-ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*Compaq*|*EliteBook*", RUN+="keymap $name hewlett-packard-compaq_elitebook" +-ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*", RUN+="keymap $name hewlett-packard-2510p_2530p" ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*Compaq*|*EliteBook*|*2230s*", RUN+="keymap $name hewlett-packard-compaq_elitebook" ++ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keymap $name hewlett-packard-2510p_2530p" + ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keymap $name hewlett-packard-tx2" ++ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100" ++# HP Pavillion dv6315ea has empty DMI_VENDOR ++ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play ++ ++# Gateway clone of Acer Aspire One AOA110/AOA150 ++ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer" + + ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer" +-ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name acer-extensa_5xxx" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C300*", RUN+="keymap $name acer-travelmate_c300" +-ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*", RUN+="keymap $name acer-travelmate_6292" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*4720*", RUN+="keymap $name 0xB2 www 0xEE screenlock" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920" + ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g" ++ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720" + +-ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name benq-joybook_r22" ++ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name 0x6E wlan" + + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pro V3205*", RUN+="keymap $name fujitsu-amilo_pro_v3205" + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pa 2548*", RUN+="keymap $name fujitsu-amilo_pa_2548" +@@ -55,6 +100,10 @@ + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*ESPRIMO Mobile V6*", RUN+="keymap $name fujitsu-esprimo_mobile_v6" + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pro Edition V3505*", RUN+="keymap $name fujitsu-amilo_pro_edition_v3505" + ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*Amilo Si 1520*", RUN+="keymap $name fujitsu-amilo_si_1520" ++ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="AMILO*M*", RUN+="keymap $name 0x97 prog2 0x9F prog1" ++ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="Amilo Li 1718", RUN+="keymap $name 0xD6 wlan" ++ ++ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name lg-x110" + + ENV{DMI_VENDOR}=="MEDION*", ATTR{[dmi/id]product_name}=="*FID2060*", RUN+="keymap $name medion-fid2060" + ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $name medionnb-a555" +@@ -70,15 +119,28 @@ + + ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" + +-ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*NC10*|*SP55S*|*SQ45S70S*|*SX60P*|*SX30S*|*R59P/R60P/R61P*|*Q210*|*Q310*|*X05*|*P560*|*R560*", RUN+="keymap $name samsung-other" ++ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keymap $name samsung-other" + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s" + ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us" + + ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100" + ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110" ++ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+="keymap $name toshiba-satellite_m30x" + + ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2" + ++ENV{DMI_VENDOR}=="ONKYO CORPORATION", ATTR{[dmi/id]product_name}=="ONKYOPC", RUN+="keymap $name onkyo" ++ + ENV{DMI_VENDOR}=="ASUS", RUN+="keymap $name asus" + ++ENV{DMI_VENDOR}=="VIA", ATTR{[dmi/id]product_name}=="K8N800", ATTR{[dmi/id]product_version}=="VT8204B", RUN+="keymap $name 0x81 prog1" ++ ++ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote", ATTR{[dmi/id]product_version}=="62*|63*", RUN+="keymap $name zepto-znote" ++ ++ENV{DMI_VENDOR}=="Everex", ATTR{[dmi/id]product_name}=="XT5000*", RUN+="keymap $name everex-xt5000" ++ ++ENV{DMI_VENDOR}=="COMPAL", ATTR{[dmi/id]product_name}=="HEL80I", RUN+="keymap $name 0x84 wlan" ++ ++ENV{DMI_VENDOR}=="OLPC", ATTR{[dmi/id]product_name}=="XO", RUN+="keymap $name olpc-xo" ++ + LABEL="keyboard_end" +diff -urN udev-145-orig/extras/keymap/check-keymaps.sh udev-145/extras/keymap/check-keymaps.sh +--- udev-145-orig/extras/keymap/check-keymaps.sh 2009-05-16 16:06:31.000000000 +0200 ++++ udev-145/extras/keymap/check-keymaps.sh 2010-06-11 10:52:56.000000000 +0200 +@@ -1,29 +1,37 @@ + #!/bin/bash + + # check that all key names in keymaps/* are known in +-KEYLIST=./keys.txt +-RULES=95-keymap.rules ++# and that all key maps listed in the rules are valid and present in ++# Makefile.am ++SRCDIR=$1 ++KEYLIST=$2 ++KEYMAPS_DIR=$SRCDIR/extras/keymap/keymaps #extras/keymap/keymaps ++RULES=$SRCDIR/extras/keymap/95-keymap.rules + + [ -e "$KEYLIST" ] || { + echo "need $KEYLIST please build first" >&2 + exit 1 + } + +-missing=$(join -v 2 <(awk '{print tolower(substr($1,5))}' $KEYLIST | sort -u) <(awk '{print $2}' keymaps/*|sort -u)) ++missing=$(join -v 2 <(awk '{print tolower(substr($1,5))}' $KEYLIST | sort -u) \ ++ <(grep -hv '^#' ${KEYMAPS_DIR}/*| awk '{print $2}' | sort -u)) + [ -z "$missing" ] || { +- echo "ERROR: unknown key names in keymaps/*:" >&2 ++ echo "ERROR: unknown key names in extras/keymap/keymaps/*:" >&2 + echo "$missing" >&2 + exit 1 + } + + # check that all maps referred to in $RULES exist +-maps=$(sed -rn '/keymap \$name/ { s/^.*\$name ([^"]+).*$/\1/; p }' $RULES) ++maps=$(sed -rn '/keymap \$name/ { s/^.*\$name ([^"[:space:]]+).*$/\1/; p }' $RULES) + for m in $maps; do +- [ -e keymaps/$m ] || { ++ # ignore inline mappings ++ [ "$m" = "${m#0x}" ] || continue ++ ++ [ -e ${KEYMAPS_DIR}/$m ] || { + echo "ERROR: unknown map name in $RULES: $m" >&2 + exit 1 + } +- grep -q "keymaps/$m\>" Makefile.am || { ++ grep -q "extras/keymap/keymaps/$m\>" $SRCDIR/Makefile.am || { + echo "ERROR: map file $m is not added to Makefile.am" >&2 + exit 1 + } +diff -urN udev-145-orig/extras/keymap/.deps/extras_keymap_keymap-keymap.Po udev-145/extras/keymap/.deps/extras_keymap_keymap-keymap.Po +--- udev-145-orig/extras/keymap/.deps/extras_keymap_keymap-keymap.Po 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/.deps/extras_keymap_keymap-keymap.Po 2010-08-11 15:14:22.000000000 +0200 +@@ -0,0 +1,208 @@ ++extras/keymap/extras_keymap_keymap-keymap.o: extras/keymap/keymap.c \ ++ config.h /usr/include/stdio.h /usr/include/features.h \ ++ /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \ ++ /usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \ ++ /usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/stddef.h \ ++ /usr/include/bits/types.h /usr/include/bits/typesizes.h \ ++ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ ++ /usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/stdarg.h \ ++ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ ++ /usr/include/bits/stdio.h /usr/include/stdlib.h \ ++ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ ++ /usr/include/endian.h /usr/include/bits/endian.h \ ++ /usr/include/bits/byteswap.h /usr/include/xlocale.h \ ++ /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ ++ /usr/include/bits/select.h /usr/include/bits/sigset.h \ ++ /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ ++ /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ ++ /usr/include/string.h /usr/include/bits/string.h \ ++ /usr/include/bits/string2.h /usr/include/ctype.h /usr/include/unistd.h \ ++ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ ++ /usr/include/bits/confname.h /usr/include/getopt.h /usr/include/errno.h \ ++ /usr/include/bits/errno.h /usr/include/linux/errno.h \ ++ /usr/include/asm/errno.h /usr/include/asm-generic/errno.h \ ++ /usr/include/asm-generic/errno-base.h \ ++ /usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/limits.h \ ++ /usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/syslimits.h \ ++ /usr/include/limits.h /usr/include/bits/posix1_lim.h \ ++ /usr/include/bits/local_lim.h /usr/include/linux/limits.h \ ++ /usr/include/bits/posix2_lim.h /usr/include/bits/xopen_lim.h \ ++ /usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \ ++ /usr/include/bits/stat.h /usr/include/sys/ioctl.h \ ++ /usr/include/bits/ioctls.h /usr/include/asm/ioctls.h \ ++ /usr/include/asm-generic/ioctls.h /usr/include/linux/ioctl.h \ ++ /usr/include/asm/ioctl.h /usr/include/asm-generic/ioctl.h \ ++ /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h \ ++ /usr/include/linux/input.h /usr/include/sys/time.h \ ++ /usr/include/linux/types.h /usr/include/asm/types.h \ ++ /usr/include/asm-generic/types.h /usr/include/asm-generic/int-ll64.h \ ++ /usr/include/asm/bitsperlong.h /usr/include/asm-generic/bitsperlong.h \ ++ /usr/include/linux/posix_types.h /usr/include/linux/stddef.h \ ++ /usr/include/asm/posix_types.h /usr/include/asm/posix_types_64.h \ ++ extras/keymap/keys-from-name.h extras/keymap/keys-to-name.h ++ ++config.h: ++ ++/usr/include/stdio.h: ++ ++/usr/include/features.h: ++ ++/usr/include/sys/cdefs.h: ++ ++/usr/include/bits/wordsize.h: ++ ++/usr/include/gnu/stubs.h: ++ ++/usr/include/gnu/stubs-64.h: ++ ++/usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/stddef.h: ++ ++/usr/include/bits/types.h: ++ ++/usr/include/bits/typesizes.h: ++ ++/usr/include/libio.h: ++ ++/usr/include/_G_config.h: ++ ++/usr/include/wchar.h: ++ ++/usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/stdarg.h: ++ ++/usr/include/bits/stdio_lim.h: ++ ++/usr/include/bits/sys_errlist.h: ++ ++/usr/include/bits/stdio.h: ++ ++/usr/include/stdlib.h: ++ ++/usr/include/bits/waitflags.h: ++ ++/usr/include/bits/waitstatus.h: ++ ++/usr/include/endian.h: ++ ++/usr/include/bits/endian.h: ++ ++/usr/include/bits/byteswap.h: ++ ++/usr/include/xlocale.h: ++ ++/usr/include/sys/types.h: ++ ++/usr/include/time.h: ++ ++/usr/include/sys/select.h: ++ ++/usr/include/bits/select.h: ++ ++/usr/include/bits/sigset.h: ++ ++/usr/include/bits/time.h: ++ ++/usr/include/sys/sysmacros.h: ++ ++/usr/include/bits/pthreadtypes.h: ++ ++/usr/include/alloca.h: ++ ++/usr/include/string.h: ++ ++/usr/include/bits/string.h: ++ ++/usr/include/bits/string2.h: ++ ++/usr/include/ctype.h: ++ ++/usr/include/unistd.h: ++ ++/usr/include/bits/posix_opt.h: ++ ++/usr/include/bits/environments.h: ++ ++/usr/include/bits/confname.h: ++ ++/usr/include/getopt.h: ++ ++/usr/include/errno.h: ++ ++/usr/include/bits/errno.h: ++ ++/usr/include/linux/errno.h: ++ ++/usr/include/asm/errno.h: ++ ++/usr/include/asm-generic/errno.h: ++ ++/usr/include/asm-generic/errno-base.h: ++ ++/usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/limits.h: ++ ++/usr/lib/gcc/x86_64-redhat-linux/4.5.0/include/syslimits.h: ++ ++/usr/include/limits.h: ++ ++/usr/include/bits/posix1_lim.h: ++ ++/usr/include/bits/local_lim.h: ++ ++/usr/include/linux/limits.h: ++ ++/usr/include/bits/posix2_lim.h: ++ ++/usr/include/bits/xopen_lim.h: ++ ++/usr/include/fcntl.h: ++ ++/usr/include/bits/fcntl.h: ++ ++/usr/include/bits/uio.h: ++ ++/usr/include/bits/stat.h: ++ ++/usr/include/sys/ioctl.h: ++ ++/usr/include/bits/ioctls.h: ++ ++/usr/include/asm/ioctls.h: ++ ++/usr/include/asm-generic/ioctls.h: ++ ++/usr/include/linux/ioctl.h: ++ ++/usr/include/asm/ioctl.h: ++ ++/usr/include/asm-generic/ioctl.h: ++ ++/usr/include/bits/ioctl-types.h: ++ ++/usr/include/sys/ttydefaults.h: ++ ++/usr/include/linux/input.h: ++ ++/usr/include/sys/time.h: ++ ++/usr/include/linux/types.h: ++ ++/usr/include/asm/types.h: ++ ++/usr/include/asm-generic/types.h: ++ ++/usr/include/asm-generic/int-ll64.h: ++ ++/usr/include/asm/bitsperlong.h: ++ ++/usr/include/asm-generic/bitsperlong.h: ++ ++/usr/include/linux/posix_types.h: ++ ++/usr/include/linux/stddef.h: ++ ++/usr/include/asm/posix_types.h: ++ ++/usr/include/asm/posix_types_64.h: ++ ++extras/keymap/keys-from-name.h: ++ ++extras/keymap/keys-to-name.h: +Binary files udev-145-orig/extras/keymap/extras_keymap_keymap-keymap.o and udev-145/extras/keymap/extras_keymap_keymap-keymap.o differ +diff -urN udev-145-orig/extras/keymap/findkeyboards udev-145/extras/keymap/findkeyboards +--- udev-145-orig/extras/keymap/findkeyboards 2009-05-16 16:06:31.000000000 +0200 ++++ udev-145/extras/keymap/findkeyboards 2010-07-08 11:37:47.000000000 +0200 +@@ -17,21 +17,25 @@ + + # print a list of input devices which are keyboard-like + keyboard_devices() { +- input_devs=`udevadm trigger --dry-run --verbose --subsystem-match=input --attr-match=dev` +- + # standard AT keyboard +- for dev in $input_devs; do +- info=`udevadm info --attribute-walk --path=$dev` +- +- if echo "$info" | grep -q 'DRIVERS=="atkbd"'; then ++ for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do ++ walk=`udevadm info --attribute-walk --path=$dev` ++ env=`udevadm info --query=env --path=$dev` ++ if echo "$walk" | grep -q 'DRIVERS=="atkbd"'; then + echo -n 'AT keyboard: ' +- udevadm info --query=name --path=$dev ++ elif echo "$env" | grep -q '^ID_USB_DRIVER=usbhid'; then ++ echo -n 'USB keyboard: ' ++ else ++ echo -n 'Unknown type: ' + fi ++ udevadm info --query=name --path=$dev + done + + # modules + module=`udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='*Extra Buttons'` + module="$module ++`udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='*extra buttons'`" ++ module="$module + `udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='Sony Vaio Keys'`" + for m in $module; do + evdev=`ls -d $m/event* 2>/dev/null` +diff -urN udev-145-orig/extras/keymap/force-release-maps/common-volume-keys udev-145/extras/keymap/force-release-maps/common-volume-keys +--- udev-145-orig/extras/keymap/force-release-maps/common-volume-keys 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/force-release-maps/common-volume-keys 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,3 @@ ++0xa0 #mute ++0xae #volume down ++0xb0 #volume up +diff -urN udev-145-orig/extras/keymap/force-release-maps/samsung-other udev-145/extras/keymap/force-release-maps/samsung-other +--- udev-145-orig/extras/keymap/force-release-maps/samsung-other 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/force-release-maps/samsung-other 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,10 @@ ++# list of scancodes (hex or decimal), optional comment ++0x82 # Fn+F4 CRT/LCD ++0x83 # Fn+F2 battery ++0x84 # Fn+F5 backlight on/off ++0x86 # Fn+F9 WLAN ++0x88 # Fn-Up brightness up ++0x89 # Fn-Down brightness down ++0xB3 # Fn+F8 switch power mode (battery/dynamic/performance) ++0xF7 # Fn+F10 Touchpad on ++0xF9 # Fn+F10 Touchpad off +diff -urN udev-145-orig/extras/keymap/.gitignore udev-145/extras/keymap/.gitignore +--- udev-145-orig/extras/keymap/.gitignore 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/.gitignore 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,6 @@ ++keymap ++keys-from-name.gperf ++keys-from-name.h ++keys-to-name.h ++keys.txt ++ +diff -urN udev-145-orig/extras/keymap/keyboard-force-release.sh udev-145/extras/keymap/keyboard-force-release.sh +--- udev-145-orig/extras/keymap/keyboard-force-release.sh 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keyboard-force-release.sh 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,22 @@ ++#!/bin/sh -e ++# read list of scancodes, convert hex to decimal and ++# append to the atkbd force_release sysfs attribute ++# $1 sysfs devpath for serioX ++# $2 file with scancode list (hex or dec) ++ ++case "$2" in ++ /*) scf="$2" ;; ++ *) scf="/lib/udev/keymaps/force-release/$2" ;; ++esac ++ ++read attr <"/sys/$1/force_release" ++while read scancode dummy; do ++ case "$scancode" in ++ \#*) ;; ++ *) ++ scancode=$(($scancode)) ++ attr="$attr${attr:+,}$scancode" ++ ;; ++ esac ++done <"$scf" ++echo "$attr" >"/sys/$1/force_release" +Binary files udev-145-orig/extras/keymap/keymap and udev-145/extras/keymap/keymap differ +diff -urN udev-145-orig/extras/keymap/keymap.c udev-145/extras/keymap/keymap.c +--- udev-145-orig/extras/keymap/keymap.c 2009-06-17 16:14:33.000000000 +0200 ++++ udev-145/extras/keymap/keymap.c 2010-06-11 10:52:56.000000000 +0200 +@@ -32,6 +32,7 @@ + #include + #include + #include ++#include + #include + + const struct key* lookup_key (const char *str, unsigned int len); +@@ -153,6 +154,34 @@ + return r; + } + ++static void set_key(int fd, const char* scancode_str, const char* keyname) ++{ ++ unsigned scancode; ++ char *endptr; ++ char t[105] = "KEY_UNKNOWN"; ++ const struct key *k; ++ ++ scancode = (unsigned) strtol(scancode_str, &endptr, 0); ++ if (*endptr != '\0') { ++ fprintf(stderr, "ERROR: Invalid scancode\n"); ++ exit(1); ++ } ++ ++ snprintf(t, sizeof(t), "KEY_%s", keyname); ++ ++ if (!(k = lookup_key(t, strlen(t)))) { ++ fprintf(stderr, "ERROR: Unknown key name '%s'\n", keyname); ++ exit(1); ++ } ++ ++ if (evdev_set_keycode(fd, scancode, k->id) < 0) ++ fprintf(stderr, "setting scancode 0x%2X to key code %i failed\n", ++ scancode, k->id); ++ else ++ printf("setting scancode 0x%2X to key code %i\n", ++ scancode, k->id); ++} ++ + static int merge_table(int fd, const char *filename) { + int r = 0; + int line = 0; +@@ -219,7 +248,7 @@ + { + static char result[PATH_MAX]; + +- /* If keymap file is given without a path, assume udev diretory; must end with '/' * */ ++ /* If keymap file is given without a path, assume udev directory; must end with '/' * */ + if (!strchr(path, '/')) { + snprintf(result, sizeof(result), "%s%s", LIBEXECDIR "/keymaps/", path); + return result; +@@ -230,15 +259,22 @@ + static void print_key(struct input_event *event) + { + static int cur_scancode = 0; ++ const char *keyname; + + /* save scan code for next EV_KEY event */ + if (event->type == EV_MSC && event->code == MSC_SCAN) + cur_scancode = event->value; + + /* key press */ +- if (event->type == EV_KEY && event->value) +- printf("scan code: 0x%02X key code: %s\n", cur_scancode, +- format_keyname(key_names[event->code])); ++ if (event->type == EV_KEY && event->value) { ++ keyname = key_names[event->code]; ++ if (keyname != NULL) ++ printf("scan code: 0x%02X key code: %s\n", cur_scancode, ++ format_keyname(key_names[event->code])); ++ else ++ printf("scan code: 0x%02X key code: %03X\n", cur_scancode, ++ event->code); ++ } + } + + static void interactive(int fd) +@@ -272,6 +308,20 @@ + ioctl(fd, EVIOCGRAB, 0); + } + ++static void help(int error) ++{ ++ const char* h = "Usage: keymap []\n" ++ " keymap scancode keyname [...]\n" ++ " keymap -i \n"; ++ if (error) { ++ fputs(h, stderr); ++ exit(2); ++ } else { ++ fputs(h, stdout); ++ exit(0); ++ } ++} ++ + int main(int argc, char **argv) + { + static const struct option options[] = { +@@ -281,6 +331,7 @@ + }; + int fd = -1; + int opt_interactive = 0; ++ int i; + + while (1) { + int option; +@@ -291,8 +342,7 @@ + + switch (option) { + case 'h': +- printf("Usage: keymap []\n\n"); +- return 0; ++ help(0); + + case 'i': + opt_interactive = 1; +@@ -302,21 +352,35 @@ + } + } + +- if (argc < optind+1 || argc > optind+2) { +- fprintf(stderr, "Usage: keymap []\n\n"); +- return 2; +- } ++ if (argc < optind+1) ++ help (1); + + if ((fd = evdev_open(argv[optind])) < 0) + return 3; + +- if (argc == optind+2) +- merge_table(fd, default_keymap_path(argv[optind+1])); +- else { ++ /* one argument (device): dump or interactive */ ++ if (argc == optind+1) { + if (opt_interactive) + interactive(fd); + else + dump_table(fd); ++ return 0; + } +- return 0; ++ ++ /* two arguments (device, mapfile): set map file */ ++ if (argc == optind+2) { ++ merge_table(fd, default_keymap_path(argv[optind+1])); ++ return 0; ++ } ++ ++ /* more arguments (device, scancode/keyname pairs): set keys directly */ ++ if ((argc - optind - 1) % 2 == 0) { ++ for (i = optind+1; i < argc; i += 2) ++ set_key(fd, argv[i], argv[i+1]); ++ return 0; ++ } ++ ++ /* invalid number of arguments */ ++ help(1); ++ return 1; /* not reached */ + } +Binary files udev-145-orig/extras/keymap/keymap-keymap.o and udev-145/extras/keymap/keymap-keymap.o differ +diff -urN udev-145-orig/extras/keymap/keymaps/acer-aspire_5720 udev-145/extras/keymap/keymaps/acer-aspire_5720 +--- udev-145-orig/extras/keymap/keymaps/acer-aspire_5720 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/acer-aspire_5720 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,5 @@ ++0x84 bluetooth # sent when bluetooth module missing, and key pressed ++0x92 media # acer arcade ++0xD4 bluetooth # bluetooth on ++0xD9 bluetooth # bluetooth off ++ +diff -urN udev-145-orig/extras/keymap/keymaps/acer-aspire_6920 udev-145/extras/keymap/keymaps/acer-aspire_6920 +--- udev-145-orig/extras/keymap/keymaps/acer-aspire_6920 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/acer-aspire_6920 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,5 @@ ++0xD9 bluetooth # (toggle) on-to-off ++0x92 media ++0x9E back ++0x83 rewind ++0x89 fastforward +diff -urN udev-145-orig/extras/keymap/keymaps/dell udev-145/extras/keymap/keymaps/dell +--- udev-145-orig/extras/keymap/keymaps/dell 2009-05-09 12:41:34.000000000 +0200 ++++ udev-145/extras/keymap/keymaps/dell 2010-06-11 10:52:56.000000000 +0200 +@@ -21,7 +21,9 @@ + 0x99 nextsong # Front panel next song + 0x9A setup # Tablet tools button + 0x9B switchvideomode # Display Toggle button ++0x9E f22 #touchpad toggle + 0xA2 playpause # Front panel play/pause + 0xA4 stopcd # Front panel stop +-0xD8 screenlock # FIXME: Tablet lock button + 0xED media # MediaDirect button ++0xD8 screenlock # FIXME: Tablet lock button ++0xD9 f22 # touchpad toggle +diff -urN udev-145-orig/extras/keymap/keymaps/everex-xt5000 udev-145/extras/keymap/keymaps/everex-xt5000 +--- udev-145-orig/extras/keymap/keymaps/everex-xt5000 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/everex-xt5000 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,7 @@ ++0x5C media ++0x65 f22 # Fn+F5 Touchpad toggle ++0x67 prog3 # Fan Speed Control button ++0x6F brightnessup ++0x7F brightnessdown ++0xB2 www ++0xEC mail +diff -urN udev-145-orig/extras/keymap/keymaps/hewlett-packard-presario-2100 udev-145/extras/keymap/keymaps/hewlett-packard-presario-2100 +--- udev-145-orig/extras/keymap/keymaps/hewlett-packard-presario-2100 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/hewlett-packard-presario-2100 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,3 @@ ++0xF0 help ++0xF1 screenlock ++0xF3 search +diff -urN udev-145-orig/extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint udev-145/extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint +--- udev-145-orig/extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/ibm-thinkpad-usb-keyboard-trackpoint 2010-07-07 10:58:29.000000000 +0200 +@@ -0,0 +1,7 @@ ++0x900f0 screenlock ++0x900f1 wlan ++0x900f2 switchvideomode ++0x900f3 suspend ++0x900f4 brightnessup ++0x900f5 brightnessdown ++0x900f8 zoom +diff -urN udev-145-orig/extras/keymap/keymaps/lenovo-ideapad udev-145/extras/keymap/keymaps/lenovo-ideapad +--- udev-145-orig/extras/keymap/keymaps/lenovo-ideapad 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/lenovo-ideapad 2010-08-17 16:31:27.000000000 +0200 +@@ -0,0 +1,7 @@ ++# Key codes observed on S10-3, assumed valid on other IdeaPad models ++0x81 rfkill # does nothing in BIOS ++0x83 display_off # BIOS toggles screen state ++0xB9 brightnessup # does nothing in BIOS ++0xBA brightnessdown # does nothing in BIOS ++0xF1 camera # BIOS toggles camera power ++0xf2 unknown # trackpad enable/disable (does nothing in BIOS) +diff -urN udev-145-orig/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint udev-145/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint +--- udev-145-orig/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,13 @@ ++0x90012 screenlock # Fn+F2 ++0x90013 battery # Fn+F3 ++0x90014 wlan # Fn+F5 ++0x90016 switchvideomode # Fn+F7 ++0x90017 f22 # Fn+F8 touchpadtoggle ++0x90019 suspend # Fn+F12 ++0x9001A brightnessup # Fn+Home ++0x9001B brightnessdown # Fn+End ++0x9001D zoom # Fn+Space ++0x90011 prog1 # Thinkvantage button ++ ++0x90015 camera # Fn+F6 headset/camera VoIP key ?? ++# 0x90010 # Microphone mute button ?? +diff -urN udev-145-orig/extras/keymap/keymaps/lg-x110 udev-145/extras/keymap/keymaps/lg-x110 +--- udev-145-orig/extras/keymap/keymaps/lg-x110 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/lg-x110 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,12 @@ ++0xA0 mute # Fn-F9 ++0xAE volumedown # Fn-Left ++0xAF search # Fn-F3 ++0xB0 volumeup # Fn-Right ++0xB1 battery # Fn-F10 Info ++0xB3 suspend # Fn-F12 ++0xDF sleep # Fn-F4 ++# 0xE2 bluetooth # satellite dish2 ++0xE4 f22 # Fn-F5 Touchpad disable ++0xF6 wlan # Fn-F6 ++0xF7 reserved # brightnessdown # Fn-Down ++0xF8 reserved # brightnessup # Fn-Up +\ No newline at end of file +diff -urN udev-145-orig/extras/keymap/keymaps/logitech-wave udev-145/extras/keymap/keymaps/logitech-wave +--- udev-145-orig/extras/keymap/keymaps/logitech-wave 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/logitech-wave 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,16 @@ ++0x9001C scale #expo ++0x9001F zoomout #zoom out ++0x90020 zoomin #zoom in ++0x9003D prog1 #gadget ++0x90005 camera #camera ++0x90018 media #media center ++0x90041 wordprocessor #fn+f1 (word) ++0x90042 spreadsheet #fn+f2 (excel) ++0x90043 calendar #fn+f3 (calendar) ++0x90044 prog2 #fn+f4 (program a) ++0x90045 prog3 #fn+f5 (program b) ++0x90046 prog4 #fn+f6 (program c) ++0x90048 messenger #fn+f8 (msn messenger) ++0x9002D find #fn+f10 (search www) ++0x9004B search #fn+f11 (search pc) ++0x9004C ejectclosecd #fn+f12 (eject) +diff -urN udev-145-orig/extras/keymap/keymaps/logitech-wave-cordless udev-145/extras/keymap/keymaps/logitech-wave-cordless +--- udev-145-orig/extras/keymap/keymaps/logitech-wave-cordless 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/logitech-wave-cordless 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,15 @@ ++0xD4 zoomin ++0xCC zoomout ++0xC0183 media ++0xC1005 camera ++0xC101F zoomout ++0xC1020 zoomin ++0xC1041 wordprocessor ++0xC1042 spreadsheet ++0xC1043 calendar ++0xC1044 prog2 #fn+f4 (program a) ++0xC1045 prog3 #fn+f5 (program b) ++0xC1046 prog4 #fn+f6 (program c) ++0xC1048 messenger ++0xC104A find #fn+f10 (search www) ++0xC104C ejectclosecd +diff -urN udev-145-orig/extras/keymap/keymaps/logitech-wave-pro-cordless udev-145/extras/keymap/keymaps/logitech-wave-pro-cordless +--- udev-145-orig/extras/keymap/keymaps/logitech-wave-pro-cordless 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/logitech-wave-pro-cordless 2010-07-07 10:58:29.000000000 +0200 +@@ -0,0 +1,12 @@ ++0xC01B6 camera ++0xC0183 media ++0xC0184 wordprocessor ++0xC0186 spreadsheet ++0xC018E calendar ++0xC0223 homepage ++0xC01BC messenger ++0xC018A mail ++0xC0221 search ++0xC00B8 ejectcd ++0xC022D zoomin ++0xC022E zoomout +diff -urN udev-145-orig/extras/keymap/keymaps/micro-star udev-145/extras/keymap/keymaps/micro-star +--- udev-145-orig/extras/keymap/keymaps/micro-star 2009-05-09 12:41:34.000000000 +0200 ++++ udev-145/extras/keymap/keymaps/micro-star 2010-06-11 10:52:56.000000000 +0200 +@@ -6,6 +6,7 @@ + 0xE2 bluetooth # satellite dish2 + 0xE4 f22 # Fn-F3 Touchpad disable + 0xEC email # envelope button ++0xEE camera # Fn-F6 camera disable + 0xF6 wlan # satellite dish1 + 0xF7 brightnessdown # Fn-F4 + 0xF8 brightnessup # Fn-F5 +diff -urN udev-145-orig/extras/keymap/keymaps/olpc-xo udev-145/extras/keymap/keymaps/olpc-xo +--- udev-145-orig/extras/keymap/keymaps/olpc-xo 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/olpc-xo 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,60 @@ ++0x59 fn ++0x81 fn_esc ++0xF9 camera ++0xF8 sound # Fn-CAMERA = Mic ++0xBB fn_f1 ++0xBC fn_f2 ++0xBD fn_f3 ++0xBE fn_f4 ++0xBF fn_f5 ++0xC0 fn_f6 ++0xC1 fn_f7 ++0xC2 fn_f8 ++0xC3 fn_f9 ++0xC4 fn_f10 ++0xD7 fn_f11 ++0xD8 fn_f12 ++ ++# Using F13-F21 for the .5 F keys right now. ++0xF7 f13 ++0xF6 f14 ++0xF5 f15 ++0xF4 f16 ++0xF3 f17 ++0xF2 f18 ++0xF1 f19 ++0xF0 f20 ++0xEF f21 ++ ++0xEE chat ++0xE4 chat # Just mapping Fn-Chat to Chat for now ++0xDD menu # Frame ++0xDA prog1 # Fn-Frame ++ ++# The FN of some keys is other keys ++0xD3 delete ++0xD2 insert ++0xC9 pageup ++0xD1 pagedown ++0xC7 home ++0xCF end ++ ++# Language key - don't ask what they are doing as KEY_HP ++0x73 hp ++0x7E hp ++ ++0xDB leftmeta # left grab ++0xDC rightmeta # right grab ++0x85 rightmeta # Right grab releases on a different scancode ++0xD6 kbdillumtoggle # Fn-space ++0x69 switchvideomode # Brightness key ++ ++# Game keys ++0x65 kp8 # up ++0x66 kp2 # down ++0x67 kp4 # left ++0x68 kp6 # right ++0xE5 kp9 # pgup ++0xE6 kp3 # pgdn ++0xE7 kp7 # home ++0xE8 kp1 # end +diff -urN udev-145-orig/extras/keymap/keymaps/onkyo udev-145/extras/keymap/keymaps/onkyo +--- udev-145-orig/extras/keymap/keymaps/onkyo 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/onkyo 2010-08-31 10:35:41.000000000 +0200 +@@ -0,0 +1,14 @@ ++0xA0 mute # Fn+D ++0xAE volumedown # Fn+F ++0xB0 volumeup # Fn+G ++0xDF sleep # Fn+W ++0xE0 bluetooth # Fn+H ++0xE2 cyclewindows # Fn+Esc ++0xEE battery # Fn+Q ++0xF0 media # Fn+R ++0xF5 switchvideomode # Fn+E ++0xF6 camera # Fn+T ++0xF7 f22 # Fn+Y (touchpad toggle) ++0xF8 brightnessup # Fn+S ++0xF9 brightnessdown # Fn+A ++0xFB wlan # Fn+J +diff -urN udev-145-orig/extras/keymap/keymaps/toshiba-satellite_m30x udev-145/extras/keymap/keymaps/toshiba-satellite_m30x +--- udev-145-orig/extras/keymap/keymaps/toshiba-satellite_m30x 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/toshiba-satellite_m30x 2010-06-11 10:52:56.000000000 +0200 +@@ -0,0 +1,7 @@ ++0xef brightnessdown ++0xd9 brightnessup ++0xee screenlock ++0x93 media ++0x9e prog1 #touchpad_enable ++0x9f prog2 #touchpad_disable ++ +diff -urN udev-145-orig/extras/keymap/keymaps/zepto-znote udev-145/extras/keymap/keymaps/zepto-znote +--- udev-145-orig/extras/keymap/keymaps/zepto-znote 1970-01-01 01:00:00.000000000 +0100 ++++ udev-145/extras/keymap/keymaps/zepto-znote 2010-03-18 16:44:52.000000000 +0100 +@@ -0,0 +1,11 @@ ++0x93 switchvideomode # Fn+F3 Toggle Video Output ++0x95 brightnessdown # Fn+F4 Brightness Down ++0x91 brightnessup # Fn+F5 Brightness Up ++0xA5 f22 # Fn+F6 Disable Touchpad ++0xA6 f22 # Fn+F6 Enable Touchpad ++0xA7 bluetooth # Fn+F10 Enable Bluetooth ++0XA9 bluetooth # Fn+F10 Disable Bluetooth ++0xF1 wlan # RF Switch Off ++0xF2 wlan # RF Switch On ++0xF4 prog1 # P1 Button ++0xF3 prog2 # P2 Button +diff -urN udev-145-orig/extras/keymap/README.keymap.txt udev-145/extras/keymap/README.keymap.txt +--- udev-145-orig/extras/keymap/README.keymap.txt 2009-06-19 19:21:26.000000000 +0200 ++++ udev-145/extras/keymap/README.keymap.txt 2010-06-11 10:52:56.000000000 +0200 +@@ -48,7 +48,8 @@ + keyboard" and possibly a "module". Some laptops (notably Thinkpads, Sonys, and + Acers) have multimedia/function keys on a separate input device instead of the + primary keyboard. The keyboard device should have a name like "input/event3". +- In the following commands, the name will be written as "input/eventX". ++ In the following commands, the name will be written as "input/eventX" (replace ++ X with the appropriate number). + + 2. Dump current mapping: + +@@ -73,6 +74,12 @@ + /lib/udev/keymaps/ for existing key map files and make sure that you use the + same structure. + ++ If the key only ever works once and then your keyboard (or the entire desktop) ++ gets stuck for a long time, then it is likely that the BIOS fails to send a ++ corresponding "key release" event after the key press event. Please note down ++ this case as well, as it can be worked around in ++ /lib/udev/keymaps/95-keyboard-force-release.rules . ++ + 4. Find out your system vendor and product: + + cat /sys/class/dmi/id/sys_vendor +@@ -84,7 +91,7 @@ + /tmp/orig-map.txt from step 2, and /tmp/udev-db.txt from step 5 + to the bug tracker, so that they can be included in the next release: + +- https://bugs.launchpad.net/udev-extras/+bugs ++ https://bugs.launchpad.net/udev/+bugs + + For local testing, copy your map file to /lib/udev/keymaps/ with an appropriate + name, and add an appropriate udev rule to /lib/udev/rules.d/95-keymap.rules: diff --git a/udev-145-modem-modeswitch.patch b/udev-145-modem-modeswitch.patch new file mode 100644 index 0000000..a27409e --- /dev/null +++ b/udev-145-modem-modeswitch.patch @@ -0,0 +1,18 @@ +diff -up udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules.modesw udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules +--- udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules.modesw 2009-06-10 20:31:14.000000000 +0200 ++++ udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules 2010-03-19 10:39:13.000000000 +0100 +@@ -5,7 +5,6 @@ SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_d + GOTO="option_zerocd_end" + + LABEL="option_zerocd_disable" +-ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="1000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6731", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" +@@ -34,5 +33,6 @@ ATTRS{idVendor}=="0af0", ATTRS{idProduct + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7501", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" ++ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d055", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd" + + LABEL="option_zerocd_end" diff --git a/udev-145-rename.patch b/udev-145-rename.patch new file mode 100644 index 0000000..4c5ff83 --- /dev/null +++ b/udev-145-rename.patch @@ -0,0 +1,20 @@ +commit 6068553195f43a2fd7987c48178de23b63a09f15 +Author: Harald Hoyer +Date: Fri Sep 18 13:14:30 2009 +0200 + + rename interfaces to _rename if rename fails + +diff --git a/udev/udev-event.c b/udev/udev-event.c +index 701c061..d5b4d09 100644 +--- a/udev/udev-event.c ++++ b/udev/udev-event.c +@@ -492,8 +492,7 @@ static int rename_netif(struct udev_event *event) + } + + /* free our own name, another process may wait for us */ +- util_strscpy(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev)); +- util_strscpy(ifr.ifr_newname, IFNAMSIZ, "_rename"); ++ util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "_rename", NULL); + err = ioctl(sk, SIOCSIFNAME, &ifr); + if (err != 0) { + err(event->udev, "error changing netif name %s to %s: %m\n", diff --git a/udev-145-rules-optical-drives-use-ID_CDROM_MEDIA_TRACK_COUNT_.patch b/udev-145-rules-optical-drives-use-ID_CDROM_MEDIA_TRACK_COUNT_.patch new file mode 100644 index 0000000..cacc5cb --- /dev/null +++ b/udev-145-rules-optical-drives-use-ID_CDROM_MEDIA_TRACK_COUNT_.patch @@ -0,0 +1,14 @@ +--- udev-145/rules/rules.d/60-persistent-storage.rules.orig 2010-09-21 10:56:28.992750001 +0200 ++++ udev-145/rules/rules.d/60-persistent-storage.rules 2010-09-21 11:36:11.395750000 +0200 +@@ -61,9 +61,9 @@ + ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" + + # probe filesystem metadata of optical drives which have a media inserted +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode" + # single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET +-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" ++KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode" + + # probe filesystem metadata of disks + KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" diff --git a/udev-147-virtio.patch b/udev-147-virtio.patch new file mode 100644 index 0000000..5a55e6f --- /dev/null +++ b/udev-147-virtio.patch @@ -0,0 +1,34 @@ +commit 25728ea1ad0c128ae504801abf1f6bfaab608d93 +Author: Amit Shah +Date: Thu Jan 21 18:45:04 2010 +0530 + + rules: Add symlink rule for virtio ports + + virtio ports spawned by the virtio_console.c driver can have 'names' + assigned to them by hosts. The ports are distinguishable using these + names. Make a rule to create a symlink to the chardev associated for a + port with a name. + + The symlink created is: + /dev/virtio-ports/org.libvirt.console0 -> /dev/vport0p0 + + if the first port for the first device was given a name of + 'org.libvirt.console0'. + + Signed-off-by: Amit Shah + +Changed by Harald Hoyer + +diff -up udev-145/rules/rules.d/50-udev-default.rules.virtio udev-145/rules/rules.d/50-udev-default.rules +--- udev-145/rules/rules.d/50-udev-default.rules.virtio 2010-03-19 11:47:36.000000000 +0100 ++++ udev-145/rules/rules.d/50-udev-default.rules 2010-03-19 11:47:52.000000000 +0100 +@@ -17,6 +17,9 @@ KERNEL=="ppp", MODE="0600" + KERNEL=="mwave", NAME="modems/mwave", GROUP="dialout" + KERNEL=="hvc*|hvsi*", GROUP="dialout" + ++# virtio serial / console ports ++KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" ++ + # mem + KERNEL=="null|zero|full|random|urandom", MODE="0666" + KERNEL=="mem|kmem|port|nvram", GROUP="kmem", MODE="0640" diff --git a/udev-post.init b/udev-post.init new file mode 100644 index 0000000..409f552 --- /dev/null +++ b/udev-post.init @@ -0,0 +1,96 @@ +#!/bin/bash +# +# udev-post Post script for udev, after all filesystems are mounted +# +# Authors: Harald Hoyer +# +# chkconfig: 12345 26 75 +# description: Moves the generated persistent udev rules to /etc/udev/rules.d +# +### BEGIN INIT INFO +# Default-Start: 12345 +# Default-Stop: 0 6 +# Required-Start: $local_fs +# Required-Stop: +# Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d +# Description: Moves the generated persistent udev rules to /etc/udev/rules.d +# Provides: udev-post +### END INIT INFO + +. /etc/rc.d/init.d/functions +. /etc/sysconfig/udev + +# See how we were called. +case "$1" in + start|reload) + [ -w /var/lock/subsys ] || exit 4 + STRING=$"Retrigger failed udev events" + echo -n $STRING + /sbin/udevadm trigger --retry-failed + success "$STRING" + echo + + STRING=$"Adding udev persistent rules" + + # copy the rules generated before / was mounted read-write + for file in /dev/.udev/tmp-rules--*; do + dest=${file##*tmp-rules--} + # check, if anything is todo + [ "$dest" = '*' ] && exit 0 + echo -n $STRING + cat $file >> /etc/udev/rules.d/$dest + rc=$? + rm -f $file + if [ "$rc" -eq "0" ]; then + success "$STRING" + echo + elif [ "$rc" -eq "1" ]; then + failure "$STRING" + echo + fi + done + + touch /var/lock/subsys/udev-post + exit 0 + ;; + stop) + [ -w /var/lock/subsys ] || exit 4 + STRING=$"Generating udev makedev cache file" + MAKEDEV="/sbin/MAKEDEV" + USE_MD5="false" + [ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true" + if [ "$USE_MD5" == "true" -a -x "$MAKEDEV" ]; then + for i in /etc/udev/makedev.d/*.nodes; do + if [ -f "$i" ]; then + # use a little caching to speedup things + md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a)) + md5file="/var/lib/udev/makedev.d/${md5}.sh" + + if [ ! -f "$md5file" ]; then + echo -n $STRING + ( sed -e 's,#.*,,g' "$i" | \ + xargs $MAKEDEV -x -a -S ) \ + > "$md5file" + rc=$? + if [ "$rc" -eq "0" ]; then + success "$STRING" + echo + elif [ "$rc" -eq "1" ]; then + failure "$STRING" + echo + fi + fi + fi + done + fi + rm -f /var/lock/subsys/udev-post + exit 0 + ;; + status) + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|reload}" + exit 2 +esac +exit 0 diff --git a/udev.git-38a3cde11bc77af49a96245b8a8a0f2b583a344c.patch b/udev.git-38a3cde11bc77af49a96245b8a8a0f2b583a344c.patch new file mode 100644 index 0000000..94e3c53 --- /dev/null +++ b/udev.git-38a3cde11bc77af49a96245b8a8a0f2b583a344c.patch @@ -0,0 +1,55 @@ +From: Kay Sievers +Date: Thu, 18 Mar 2010 10:14:32 +0000 (+0100) +Subject: cdrom_id: open non-mounted optical media with O_EXCL +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=38a3cde11bc77af49a96245b8a8a0f2b583a344c + +cdrom_id: open non-mounted optical media with O_EXCL + +This should prevent confusing drives during CD burning sessions. Based +on a patch from Harald Hoyer. +--- + +diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c +index 2380b15..e485768 100644 +--- a/extras/cdrom_id/cdrom_id.c ++++ b/extras/cdrom_id/cdrom_id.c +@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset; + #define ASC(errcode) (((errcode) >> 8) & 0xFF) + #define ASCQ(errcode) ((errcode) & 0xFF) + ++static int is_mounted(const char *device) ++{ ++ struct stat statbuf; ++ FILE *fp; ++ int maj, min; ++ int mounted = 0; ++ ++ if (stat(device, &statbuf) < 0) ++ return -ENODEV; ++ ++ fp = fopen("/proc/self/mountinfo", "r"); ++ if (fp == NULL) ++ return -ENOSYS; ++ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) { ++ /* printf("got %u %u\n", maj, min); */ ++ if (makedev(maj, min) == statbuf.st_rdev) { ++ mounted = 1; ++ break; ++ } ++ } ++ fclose(fp); ++ return mounted; ++} ++ + static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err) + { + if (err == -1) { +@@ -568,7 +592,7 @@ int main(int argc, char *argv[]) + goto exit; + } + +- fd = open(node, O_RDONLY | O_NONBLOCK); ++ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL)); + if (fd < 0) { + info(udev, "unable to open '%s'\n", node); + fprintf(stderr, "unable to open '%s'\n", node); diff --git a/udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch b/udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch new file mode 100644 index 0000000..3fdf20a --- /dev/null +++ b/udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch @@ -0,0 +1,34 @@ +From: Martin Pitt +Date: Tue, 9 Feb 2010 14:47:47 +0000 (+0100) +Subject: Fix brightness keys on MSI Wind U-100 +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=d7e2d38c1f0ead2239808dd117577a99a3ad3cde + +Fix brightness keys on MSI Wind U-100 + +The MSI Wind 100 generates ACPI/input events on the LNXVIDEO input device. On +top of that, the video module/BIOS synthesize some extra event on atkbd as an +echo of actually changing the brightness. + +Ignore the wrong and useless atkbd ones, to avoid event loops. + +Many thanks to Hans de Goede for tracking this down! + +https://launchpad.net/bugs/415023 +--- + +diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules +index 51c8c3b..684619b 100644 +--- a/extras/keymap/95-keymap.rules ++++ b/extras/keymap/95-keymap.rules +@@ -98,6 +98,11 @@ ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $ + + ENV{DMI_VENDOR}=="MICRO-STAR*", RUN+="keymap $name micro-star" + ++# some MSI models generate ACPI/input events on the LNXVIDEO input devices, ++# plus some extra synthesized ones on atkbd as an echo of actually changing the ++# brightness; so ignore those atkbd ones, to avoid loops ++ENV{DMI_VENDOR}=="MICRO-STAR*", ATTR{[dmi/id]product_name}=="*U-100*|*U100*|*N033", RUN+="keymap $name 0xF7 reserved 0xF8 reserved" ++ + ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN+="keymap $name inventec-symphony_6.0_7.0" + + ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000" diff --git a/udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch b/udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch new file mode 100644 index 0000000..b871e7e --- /dev/null +++ b/udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch @@ -0,0 +1,29 @@ +From: Marco d'Itri +Date: Thu, 7 Jan 2010 15:17:22 +0000 (+0100) +Subject: rules: udev-acl - add firewire video devices +X-Git-Tag: 150~4 +X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=fa0612104ad30d4228aa7782308a77e21b7f6fb5 + +rules: udev-acl - add firewire video devices +--- + +diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules +index f135bff..ab2984c 100644 +--- a/extras/udev-acl/70-acl.rules ++++ b/extras/udev-acl/70-acl.rules +@@ -33,6 +33,15 @@ SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1" + SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1" + SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1" + ++# IIDC devices: industrial cameras and some webcams ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", ENV{ACL_MANAGE}="1" ++# AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more ++SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", ENV{ACL_MANAGE}="1" ++ ++# old style firewire devices ++KERNEL=="dv1394-[0-9]*", ENV{ACL_MANAGE}="1" ++KERNEL=="video1394-[0-9]*", ENV{ACL_MANAGE}="1" ++ + # fingerprint readers + SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1" + diff --git a/udev.spec b/udev.spec index ed0d63d..c9bf04a 100644 --- a/udev.spec +++ b/udev.spec @@ -1,423 +1,1251 @@ -# if we want to build the static version with klibc or not -# 0 - build with glibc -# 1 - build with klibc -%define klibc 0 - -# if we want to build the volume_id "extra" package or not -# 0 - do not build the package -# 1 - build it -%define volume_id 1 - -# if we want to build the scsi_id "extra" package or not -# 0 - do not build the package -# 1 - build it -%define scsi_id 1 - -%define chassis_id 0 - -# if we want to build pam_console support -# 0 - do not build the package -# 1 - build it -%define pam_console 1 - -%define udev_kernel_includes 2.6.6 - %define debug true - -%define with_persistent 0 +%define udev_scriptdir /lib/udev +%define firmwaredir /lib/firmware Summary: A userspace implementation of devfs Name: udev -Version: 039 -Release: 7 -License: GPL +Version: 145 +Release: 22%{?dist} +License: GPLv2 Group: System Environment/Base -%if !%{with_persistent} -Provides: udev-persistent = 0:%{version}-%{release} +Provides: udev-persistent = %{version}-%{release} Obsoletes: udev-persistent < 0:030-5 -%endif -Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.gz -Source1: udev.rules -Source2: udev.permissions -Source3: udev.conf -Source4: pam_console.dev -Source5: MAKEDEV.dev +Obsoletes: udev-extras < 20090618 +Provides: udev-extras = 20090618-1 +Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/%{name}-%{version}.tar.bz2 -Source10: pam_console_setowner-1.4.tgz +Patch1: 0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch +Patch2: 0002-udevd-add-timestamp-to-debug-output.patch +Patch3: 0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch +Patch4: 0004-fix-single-session-CD-detection.patch +Patch5: 0005-fix-previous-commit-for-CD-detection.patch +Patch6: ck-runseat.patch +Patch7: udev-141-cpu-online.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=532628 +Patch8: udev-145-hid2hci-backport.patch +Patch9: udev-145-modem-modeswitch.patch +Patch10: 0001-cdrom_id-Still-check-profiles-even-if-there-is-no-me.patch +Patch11: udev-145-rename.patch +Patch13: udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch +Patch14: udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch +Patch15: udev-145-rules-optical-drives-use-ID_CDROM_MEDIA_TRACK_COUNT_.patch +Patch16: udev-145-keymap-backport.patch +Patch17: udev-145-floppy.patch -Source11: ata_identify.c -Source12: ata_identify-Makefile +Patch35: 0035-cdrom_id-open-non-mounted-optical-media-with-O_EXCL.patch +Patch48: 0048-cdrom_id-remove-debugging-code.patch +Patch49: 0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch +Patch50: 0050-cdrom_id-check-mount-state-in-retry-loop.patch +Patch51: 0051-cdrom_id-always-set-ID_CDROM-regardless-if-we-can-ru.patch +Patch62: 0062-cdrom_id-Fix-uninitialized-variables.patch +Patch65: 0065-cdrom_id-Fix-uninitialized-buffers.patch +Patch66: 0066-cdrom_id.patch +Patch67: 0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch +Patch68: 0068-cdrom_id-print-more-debug-messages.patch +Patch69: 0069-cdrom_id-debug-print-feature-values-in-hex.patch +Patch70: 0070-cdrom_id-debug-print-feature-values-in-hex.patch +Patch71: 0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch +Patch72: 0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch +Patch74: 0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch +Patch75: 0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch -Source13: udev.get_persistent_device_name.sh -Source14: udev.get_unique_hardware_path.sh -Source15: udev.get_unique_drive_id.sh -Source16: udev.rules.persistent -Source17: check-cdrom.sh +Patch80: udev-145-cdrom_id-backport.patch -Source20: start_udev -Source21: udev.html +Patch110: 0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch -%if %{klibc} -Source30: include-linux-%{udev_kernel_includes}.tar.bz2 -%endif -Patch1: udev-039-static.patch -Patch2: udev-025-volsbin.patch -Patch3: udev-039-wait-error-log.patch -Patch4: udev-039-logging.patch -Patch5: udev-039-wait-ppp-class.patch -Patch6: udev-039-wait-dm-block.patch -Patch7: udev-039-static2.patch -Patch8: udev-039-netif.patch -Patch9: udev-039-dummy.patch -Patch10: udev-039-volume_id-nonblock.patch -Patch11: udev-039-norm.patch +Patch101: udev-147-virtio.patch -Patch22: udev-032-symlink.patch -Patch24: udev-038-volmak.patch - -%if %{klibc} -Patch30: include-linux-2.6.6-fdset.patch -Patch31: include-linux-2.6.6-ia64-page.patch -Patch32: include-linux-2.6.6-ia64-break.patch -Patch33: include-linux-2.6.6-s390-bitops.patch - -Patch40: udev-025-klibc-strnlen.patch -Patch41: udev-029-lseek64.patch -Patch42: klibc-0.115-ia64.patch -Patch43: klibc-0.148.ia64.patch -Patch44: klibc-0.148-getpagesize.patch -%endif +Source1: start_udev +Source3: udev-post.init +Source4: fw_unit_symlinks.sh +Source5: udev.sysconfig ExclusiveOS: Linux -URL: http://kernel.org/pub/linux/utils/kernel/hotplug/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -Prereq: /bin/sh fileutils hotplug -Prereq: MAKEDEV >= 0:3.11 -BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex -Requires: libselinux >= 0:1.17.9-2 MAKEDEV -Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 -Obsoletes: dev -Provides: dev = 0:3.12-1 +URL: http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires(pre): /bin/sh fileutils /sbin/chkconfig /sbin/service +Requires(pre): /usr/bin/stat /sbin/pidof +Requires(pre): MAKEDEV >= 0:3.11 /usr/bin/getent /usr/sbin/groupadd +Requires: hwdata -%if %{pam_console} -BuildRequires: pam-devel glib2-devel bison -Requires: pam -%endif +BuildRequires: automake autoconf +BuildRequires: sed libselinux-devel >= 0:1.17.9-2 flex libsepol-devel +BuildRequires: glib2-devel bison findutils MAKEDEV +BuildRequires: gperf +BuildRequires: libusb-devel libacl-devel +BuildRequires: libxslt +BuildRequires: hwdata +BuildRequires: gobject-introspection-devel >= 0.6.2 +BuildRequires: gtk-doc +BuildRequires: usbutils >= 0.82 +BuildRequires: libtool >= 2.2.6 +Requires: libselinux >= 0:1.17.9-2 sed +Conflicts: kernel < 0:2.6 mkinitrd <= 0:4.1.11-1 initscripts < 7.84 +Requires: util-linux-ng >= 2.15.1 +Obsoletes: dev <= 0:3.12-1 +Provides: dev = 0:3.12-2 +Obsoletes: DeviceKit < 004 +Obsoletes: DeviceKit-devel < 004 +Provides: DeviceKit = 004 DeviceKit-devel = 004 +# hid2hci moved to udev +Conflicts: bluez < 4.47 %description -udev is a implementation of devfs in userspace using sysfs and -/sbin/hotplug. It requires a 2.6 kernel to run properly. +The udev package contains an implementation of devfs in +userspace using sysfs and netlink. -%if %{with_persistent} -%package -n udev-persistent -Summary: Persistent device naming with udev -Group: Utilities/System -PreReq: udev = 0:%{version}-%{release} -Requires: sed +%package -n libudev +Summary: Dynamic library to access udev device information +Group: System Environment/Libraries +Obsoletes: libudev0 <= 142 +Provides: libudev0 = 143 +License: LGPLv2+ -%description -n udev-persistent -udev-persistent enables persistent device naming with udev. -%endif +%description -n libudev +This package contains the dynamic library libudev, which provides access +to udev device information, and an interface to search devices in sysfs. -%define add %{nil} +%package -n libudev-devel +Summary: Development files for libudev +Group: Development/Libraries +Requires: udev = %{version}-%{release} +Requires: libudev = %{version}-%{release} +License: LGPLv2+ + +%description -n libudev-devel +This package contains the development files for the library libudev, a +dynamic library, which provides access to udev device information. + +%package -n libgudev1 +Summary: Libraries for adding libudev support to applications that use glib +Group: Development/Libraries +Requires: libudev >= 142 +# remove the following lines for libgudev so major 1 +Provides: libgudev = 20090518 +Obsoletes: libgudev <= 20090517 +License: LGPLv2+ + +%description -n libgudev1 +This package contains the libraries that make it easier to use libudev +functionality from applications that use glib. + +%package -n libgudev1-devel +Summary: Header files for adding libudev support to applications that use glib +Group: Development/Libraries +Requires: libudev-devel >= 142 +Provides: libgudev-devel = 20090518 +Obsoletes: libgudev-devel <= 20090517 +License: LGPLv2+ + +Requires: libgudev1 = %{version}-%{release} + +%description -n libgudev1-devel +This package contains the header and pkg-config files for developing +glib-based applications using libudev functionality. %prep -%if %{pam_console} -%define pamadd -a 10 -%endif -%if %{klibc} -%define klibcadd -a 30 -%endif -%setup -q %{pamadd} %{klibcadd} +%setup -q +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 -b .ck041 +%patch7 -p1 +%patch8 -p1 -b .hid2hci +%patch9 -p1 -b .modesw +%patch10 -p1 +%patch11 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 -b .floppy -%patch1 -p1 -b .glibcstatic -%patch2 -p1 -b .volsbin -%patch3 -p1 -b .waiterrorlog -%patch4 -p1 -b .closelog -%patch5 -p1 -b .waitppp -%patch6 -p1 -b .waitdm -%patch7 -p1 -b .udevstatic -%patch8 -p1 -b .netif -%patch9 -p1 -b .dummy -%patch10 -p1 -b .nonblock -%patch11 -p1 -b .norm +%patch35 -p1 -b .git35 +%patch48 -p1 -b .git48 +%patch49 -p1 -b .git49 +%patch50 -p1 -b .git50 +%patch51 -p1 -b .git51 +%patch62 -p1 -b .git62 +%patch65 -p1 -b .git65 -%patch22 -p1 -b .symlink -touch etc/init.d/udev.debian -%patch24 -p1 -b .volmak +%patch66 -p1 -b .git66 +%patch67 -p1 -b .git67 +%patch68 -p1 -b .git68 +%patch69 -p1 -b .git69 +%patch70 -p1 -b .git70 +%patch71 -p1 -b .git71 +%patch72 -p1 -b .git72 +%patch74 -p1 -b .git74 +%patch75 -p1 -b .git75 -%if %{with_persistent} -mkdir ata_identify -cp %{SOURCE11} ata_identify -cp %{SOURCE12} ata_identify/Makefile -%endif +%patch80 -p1 -cp %{SOURCE21} . +%patch110 -p1 -b .git110 -%if %{klibc} -mkdir -p klibc/klibc/linux -mv include-linux-%{udev_kernel_includes} klibc/klibc/linux/include -pushd klibc/klibc/linux/include -for i in `find -type f`;do grep -Eq 'linux/(autoconf|config).h' $i || continue ; sed '/linux\/autoconf.h/d;/linux\/config.h/d' < $i > $i. ; mv $i. $i ; done -ln -sv asm-`uname -m | -sed -e s/i.86/i386/ \ --e s/sun4u/sparc64/ \ --e s/arm.*/arm/ \ --e s/sa110/arm/ \ --e s/s390x/s390/ \ --e s/parisc64/parisc/` asm -popd -%patch30 -p1 -b .fdset -%patch31 -p1 -b .page -%patch32 -p1 -b .break -%patch33 -p1 -b .bitops +%patch101 -p1 -pushd klibc -%patch40 -p2 -b .strnlen -%patch41 -p2 -b .lseek64 -%patch42 -p1 -b .p40 -%patch43 -p1 -b .p41 -#%patch44 -p1 -b .p42 -popd -%endif +autoreconf -i +automake %build +# get rid of rpath +libtoolize -f -c +%configure --with-selinux --prefix=%{_prefix} --exec-prefix="" \ + --sysconfdir=%{_sysconfdir} --with-libdir-name=%{_lib} \ + --sbindir="/sbin" --libexecdir=%{udev_scriptdir} \ + --with-rootlibdir=/%{_lib} --enable-introspection \ + --disable-rpath --enable-debug -# Do not USE_LOG in udev.static, cause it causes segfaults on openlog (bug 136005) -%if %{klibc} -make CC="gcc $RPM_OPT_FLAGS -D__user=''" KERNEL_DIR="$PWD/klibc/klibc/linux" \ - USE_KLIBC=true \ - USE_SELINUX=false \ -%else -make CC="gcc $RPM_OPT_FLAGS -DUDEV_STATIC" LD="gcc $RPM_OPT_FLAGS -static" \ - USE_KLIBC=false \ - USE_SELINUX=true \ -%endif - udevdir="/dev" \ - USE_LOG=false DEBUG=%{debug} \ - EXTRAS="" udev - -mv udev udev.static -make clean - -make CC="gcc $RPM_OPT_FLAGS" \ - USE_KLIBC=false \ - USE_SELINUX=true \ - udevdir="/dev" \ - USE_LOG=true \ - DEBUG=%{debug} \ - EXTRAS=" \ -%if %{scsi_id} - extras/scsi_id \ -%endif -%if %{volume_id} - extras/volume_id \ -%endif -%if %{chassis_id} - extras/chassis_id \ -%endif -%if %{with_persistent} - ata_identify" -%else - " -%endif - - - -%if %{pam_console} -pushd pam_console_setowner -make LIBDIR=%{_libdir} -popd -%endif - +make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_sbindir} -make DESTDIR=$RPM_BUILD_ROOT install \ - EXTRAS=" \ -%if %{scsi_id} - extras/scsi_id \ +make install DESTDIR=$RPM_BUILD_ROOT + +rm -fr $RPM_BUILD_ROOT%{_docdir}/udev +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la + +# Deprecated, but keep the ownership +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,makedev.d,scripts,devices} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d +mkdir -p $RPM_BUILD_ROOT%{_bindir} +touch $RPM_BUILD_ROOT%{_sysconfdir}/scsi_id.config + +# force relative symlinks +ln -sf ..%{udev_scriptdir}/scsi_id $RPM_BUILD_ROOT/sbin/scsi_id + +ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevinfo +ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_bindir}/udevtest +ln -sf ../../sbin/udevadm $RPM_BUILD_ROOT%{_sbindir}/udevmonitor + +ln -sf udevadm $RPM_BUILD_ROOT/sbin/udevtrigger +ln -sf udevadm $RPM_BUILD_ROOT/sbin/udevsettle +ln -sf udevadm $RPM_BUILD_ROOT/sbin/udevcontrol + +for i in \ + rules/redhat/40-redhat.rules \ +%ifarch ia64 + rules/packages/40-ia64.rules \ %endif -%if %{volume_id} - extras/volume_id \ +%ifarch ppc ppc64 + rules/packages/40-ppc.rules \ %endif -%if %{chassis_id} - extras/chassis_id \ -%endif -%if %{with_persistent} - ata_identify" -%else - " +%ifarch s390 s390x + rules/packages/40-s390.rules \ %endif + rules/packages/40-isdn.rules \ + rules/packages/40-alsa.rules \ + rules/packages/64-md-raid.rules \ + rules/packages/64-device-mapper.rules \ + ; do + install -m 0644 "$i" "$RPM_BUILD_ROOT%{udev_scriptdir}/rules.d/${i##*/}" +done + +mkdir -p $RPM_BUILD_ROOT%{udev_scriptdir}/{,devices} - -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.rules -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.permissions -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/udev - -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/udev/{rules.d,permissions.d,scripts,devices} -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/{default,block} - -install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/50-udev.rules -install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/udev/permissions.d/50-udev.permissions - -install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/udev/udev.conf - -mv $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/net/hotplug.dev $RPM_BUILD_ROOT%{_sysconfdir}/udev/scripts/ -ln -s ../../udev/scripts/hotplug.dev $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/net/ -# obsoleted by selinux patch -#install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/default -install -m 0755 udev.static $RPM_BUILD_ROOT/sbin/udev.static -ln -s udev.static $RPM_BUILD_ROOT/sbin/udevstart.static - -%if %{with_persistent} -#persistent -install -m 0755 %{SOURCE13} $RPM_BUILD_ROOT/sbin -install -m 0755 %{SOURCE14} $RPM_BUILD_ROOT/sbin -install -m 0755 %{SOURCE15} $RPM_BUILD_ROOT/sbin -install -m 0644 %{SOURCE16} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/51-udev-persistent.rules -install -m 0644 extras/volume_id/s390-dasd.rules $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/52-udev-s390-persistent.rules -%endif - -%if %{pam_console} -install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/udev/scripts/ -ln -s ../../udev/scripts/pam_console.dev $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/default/05-pam_console.dev -install -m 0755 pam_console_setowner/pam_console_setowner $RPM_BUILD_ROOT/sbin -%endif - -install -m 0755 %{SOURCE17} $RPM_BUILD_ROOT%{_sysconfdir}/udev/scripts/ +install -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{udev_scriptdir}/fw_unit_symlinks.sh mkdir -p $RPM_BUILD_ROOT%{_datadir}/udev -install -m 0644 %{SOURCE20} $RPM_BUILD_ROOT/sbin/start_udev +install -m 0755 %{SOURCE1} $RPM_BUILD_ROOT/sbin/start_udev -# floppy madness -for i in 0 1 2 3;do - mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/fd$i - ln -s ../../udev/scripts/MAKEDEV.dev $RPM_BUILD_ROOT%{_sysconfdir}/dev.d/fd$i/10-MAKEDEV.dev -done -install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/udev/scripts/ +mkdir -p -m 0755 $RPM_BUILD_ROOT%{firmwaredir} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d +install -m 0755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/udev-post +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig +install -m 0755 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/udev + +mkdir -p $RPM_BUILD_ROOT/var/lib/udev/makedev.d %preun -if [ $1 = 0 -a -f %{_initrddir}/udev ]; then +if [ "$1" -eq 0 -a -f %{_initrddir}/udev ]; then + if [ -x /sbin/pidof ]; then + pid=$(/sbin/pidof -c udevd) + if [ -n "$pid" ]; then + kill $pid + fi + fi /sbin/chkconfig --del udev fi +if [ "$1" -eq 0 ]; then + /sbin/chkconfig --del udev-post +fi +exit 0 + +%pre +# to be removed after F10 EOL (and for RHEL-6) +getent group video >/dev/null || /usr/sbin/groupadd -g 39 video || : +getent group audio >/dev/null || /usr/sbin/groupadd -g 63 audio || : +# to be kept +getent group cdrom >/dev/null || /usr/sbin/groupadd -g 11 cdrom || : +getent group tape >/dev/null || /usr/sbin/groupadd -g 33 tape || : +getent group dialout >/dev/null || /usr/sbin/groupadd -g 18 dialout || : + +# kill daemon if we are not in a chroot +if test -f /proc/1/exe -a -d /proc/1/root; then + if test -x /usr/bin/stat -a "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + if test -x /sbin/udevd -a -x /sbin/pidof ; then + /sbin/udevadm control --stop-exec-queue + pid=$(/sbin/pidof -c udevd) + while [ -n "$pid" ]; do + for p in $pid; do + kill $hard $p; + done + pid=$(/sbin/pidof -c udevd) + hard="-9" + done + fi + fi +fi exit 0 %post -if [ "$1" -ge "1" -a -x /sbin/pidof ]; then - pid=`/sbin/pidof -x udevd` - [ -n "$pid" ] && kill $pid +# start daemon if we are not in a chroot +if test -f /proc/1/exe -a -d /proc/1/root; then + if test "$(/usr/bin/stat -Lc '%%D-%%i' /)" = "$(/usr/bin/stat -Lc '%%D-%%i' /proc/1/root)"; then + /sbin/udevd -d + /sbin/udevadm control --start-exec-queue + fi fi +/sbin/chkconfig --add udev-post + exit 0 -%triggerpostun -- dev <= 0:3.12-1 -if [ $2 = 0 ]; then - if [ -x /sbin/MAKEDEV ]; then - /sbin/MAKEDEV null - else - /bin/mknod /dev/null c 1 3 - fi - /sbin/start_udev >/dev/null 2>&1 -fi -exit 0 +%triggerin -- selinux-policy +rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : + +%triggerin -- MAKEDEV +rm -f /var/lib/udev/makenode.d/* >/dev/null 2>&1 || : + +%post -n libudev -p /sbin/ldconfig +%postun -n libudev -p /sbin/ldconfig + +%post -n libgudev1 -p /sbin/ldconfig +%postun -n libgudev1 -p /sbin/ldconfig %clean rm -rf $RPM_BUILD_ROOT %files -%defattr(-,root,root) -%doc COPYING README TODO ChangeLog HOWTO* docs/* udev.html -%doc etc/udev/udev.rules.{examples,redhat} -%doc etc/udev/udev.permissions.redhat - -%attr(0755,root,root) /sbin/udev -%attr(0755,root,root) /sbin/udev.static -%attr(0755,root,root) /sbin/udevsend +%defattr(0644, root, root, 0755) +%doc COPYING README TODO ChangeLog docs/* extras/keymap/README.keymap.txt NEWS +%attr(0755,root,root) /sbin/udevadm +%attr(0755,root,root) /sbin/udevsettle +%attr(0755,root,root) /sbin/udevtrigger +%attr(0755,root,root) /sbin/udevcontrol %attr(0755,root,root) /sbin/udevd -%attr(0755,root,root) /sbin/udevstart -%attr(0755,root,root) /sbin/udevstart.static %attr(0755,root,root) /sbin/start_udev -%attr(0755,root,root) /sbin/wait_for_sysfs -%if %{with_persistent} -%attr(755,root,root) /sbin/ata_identify -%endif +%attr(0755,root,root) /sbin/scsi_id +%attr(0755,root,root) %{udev_scriptdir}/scsi_id +%attr(0755,root,root) %{udev_scriptdir}/ata_id +%attr(0755,root,root) %{udev_scriptdir}/edd_id +%attr(0755,root,root) %{udev_scriptdir}/usb_id +%attr(0755,root,root) %{udev_scriptdir}/cdrom_id +%attr(0755,root,root) %{udev_scriptdir}/path_id +%attr(0755,root,root) %{udev_scriptdir}/hid2hci +%attr(0755,root,root) %{udev_scriptdir}/create_floppy_devices +%attr(0755,root,root) %{udev_scriptdir}/fw_unit_symlinks.sh +%attr(0755,root,root) %{udev_scriptdir}/firmware.sh +%attr(0644,root,root) %{udev_scriptdir}/rule_generator.functions +%attr(0755,root,root) %{udev_scriptdir}/write_cd_rules +%attr(0755,root,root) %{udev_scriptdir}/write_net_rules +%attr(0755,root,root) %{udev_scriptdir}/collect +%attr(0755,root,root) %{udev_scriptdir}/fstab_import +%attr(0755,root,root) %dir %{udev_scriptdir}/rules.d/ +%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/udev-post %attr(0755,root,root) %{_bindir}/udevtest %attr(0755,root,root) %{_bindir}/udevinfo - +%attr(0755,root,root) %{_sbindir}/udevmonitor %attr(0755,root,root) %dir %{_sysconfdir}/udev/ %attr(0755,root,root) %dir %{_sysconfdir}/udev/rules.d/ -%attr(0755,root,root) %dir %{_sysconfdir}/udev/permissions.d/ -%attr(0755,root,root) %dir %{_sysconfdir}/udev/scripts/ -%attr(0755,root,root) %dir %{_sysconfdir}/udev/devices/ +%attr(0755,root,root) %dir %{udev_scriptdir}/ +%attr(0755,root,root) %dir %{udev_scriptdir}/devices/ +%attr(0755,root,root) %dir %{_sysconfdir}/udev/makedev.d/ - -%if %{pam_console} -%attr(0755,root,root) /sbin/pam_console_setowner -%attr(0755,root,root) %{_sysconfdir}/udev/scripts/pam_console.dev -%config(missingok) %{_sysconfdir}/dev.d/default/05-pam_console.dev -%endif - -%config(missingok) %{_sysconfdir}/dev.d/net/hotplug.dev - -# floppy madness -%attr(0755,root,root) %dir %{_sysconfdir}/dev.d/ -%attr(0755,root,root) %dir %{_sysconfdir}/dev.d/fd0 -%attr(0755,root,root) %dir %{_sysconfdir}/dev.d/fd1 -%attr(0755,root,root) %dir %{_sysconfdir}/dev.d/fd2 -%attr(0755,root,root) %dir %{_sysconfdir}/dev.d/fd3 -%config(missingok) %{_sysconfdir}/dev.d/fd?/* -%attr(0755,root,root) %{_sysconfdir}/udev/scripts/MAKEDEV.dev - -%attr(0755,root,root) %{_sysconfdir}/udev/scripts/hotplug.dev -%attr(0755,root,root) %{_sysconfdir}/udev/scripts/check-cdrom.sh +%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/sysconfig/udev %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/udev/udev.conf -%config %attr(0644,root,root) %{_sysconfdir}/udev/rules.d/50-udev.rules -%config %attr(0644,root,root) %{_sysconfdir}/udev/permissions.d/50-udev.permissions +%attr(0644,root,root) %{udev_scriptdir}/rules.d/*.rules +%ghost %config(noreplace,missingok) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config -%config(missingok) %{_sysconfdir}/hotplug.d/default/05-wait_for_sysfs.hotplug -%config(missingok) %{_sysconfdir}/hotplug.d/default/10-udev.hotplug - +%dir %attr(0755,root,root) %{firmwaredir} %attr(0644,root,root) %{_mandir}/man8/udev*.8* +%attr(0644,root,root) %{_mandir}/man7/udev*.7* +%attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* + +%dir %attr(0755,root,root) /var/lib/udev +%dir %attr(0755,root,root) /var/lib/udev/makedev.d + +# Deprecated, but keep the ownership +%ghost %dir %{_sysconfdir}/udev/scripts/ +%ghost %dir %{_sysconfdir}/udev/devices/ +%ghost %dir %{_sysconfdir}/dev.d/ + +%attr(0755,root,root) %{udev_scriptdir}/modem-modeswitch +%attr(0755,root,root) %{udev_scriptdir}/pci-db +%attr(0755,root,root) %{udev_scriptdir}/usb-db +%attr(0755,root,root) %{udev_scriptdir}/keymap +%attr(0755,root,root) %{udev_scriptdir}/udev-acl +%attr(0755,root,root) %{udev_scriptdir}/v4l_id +%attr(0755,root,root) %{udev_scriptdir}/findkeyboards +%dir %attr(0755,root,root) %{udev_scriptdir}/keymaps +%attr(0644,root,root) %{udev_scriptdir}/keymaps/* +%attr(0644,root,root) %{_prefix}/lib/ConsoleKit/run-seat.d/udev-acl.ck -%if %{scsi_id} - %attr(755,root,root) /sbin/scsi_id - %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/scsi_id.config - %attr(0644,root,root) %{_mandir}/man8/scsi_id*.8* -%endif -%if %{volume_id} - %attr(755,root,root) /sbin/udev_volume_id -%endif -%if %{chassis_id} - %attr(755,root,root) /sbin/chassis_id -%endif +%files -n libudev +%defattr(0644, root, root, 0755) +%attr(0755,root,root) /%{_lib}/libudev.so.* -%if %{with_persistent} -%files -n udev-persistent -%config %attr(0644,root,root) %{_sysconfdir}/udev/rules.d/51-udev-persistent.rules -%attr(0755,root,root) /sbin/udev.get_persistent_device_name.sh -%attr(0755,root,root) /sbin/udev.get_unique_hardware_path.sh -%attr(0755,root,root) /sbin/udev.get_unique_drive_id.sh -%if %{volume_id} -%attr(0644,root,root) %{_sysconfdir}/udev/rules.d/52-udev-s390-persistent.rules -%endif +%files -n libudev-devel +%defattr(0644, root, root, 0755) +%{_includedir}/libudev.h +%{_libdir}/libudev.so +%{_libdir}/pkgconfig/libudev.pc +%{_datadir}/pkgconfig/udev.pc +%{_datadir}/gtk-doc/html/libudev/* -%endif +%files -n libgudev1 +%defattr(0644, root, root, 0755) +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so.* +%attr(0644,root,root) %{_libdir}/girepository-1.0/GUdev-1.0.typelib + +%files -n libgudev1-devel +%defattr(0644, root, root, 0755) +%attr(0755,root,root) %{_libdir}/libgudev-1.0.so +%attr(0644,root,root) %{_includedir}/gudev-1.0/gudev/*.h +%attr(0644,root,root) %{_datadir}/gir-1.0/GUdev-1.0.gir +%dir %{_datadir}/gtk-doc/html/gudev +%attr(0644,root,root) %{_datadir}/gtk-doc/html/gudev/* +%attr(0644,root,root) %{_libdir}/pkgconfig/gudev-1.0* %changelog -* Mon Oct 25 2004 Harald Hoyer - 039-7 -- speedup pam_console.dev -- redirect udevstart completly to /dev/null +* Tue Sep 21 2010 Harald Hoyer 145-22 +- backported the upstream cdrom_id bugfixes and enhancements + (bug #533643) +- backported the upstream keymaps bugfixes and enhancements + (bug #444440) +- fixed floppy devices (bug#492404) + +* Tue Apr 27 2010 Harald Hoyer 145-21 +- more cdrom_id bugfixes which can prevent autoclose of + some cdroms + +* Tue Apr 13 2010 Harald Hoyer 145-20 +- more cdrom_id bugfixes for buggy cdroms and CD burning + (bug #577659, bug#566535, bug#561003, bug#481346, bug#580812) + +* Mon Mar 22 2010 Harald Hoyer 145-19 +- only correct the timestamp, if UTC=="no" + +* Mon Mar 22 2010 Harald Hoyer 145-18 +- touch with "--no-create", will not use open() + and trigger devs/watchdogs (bug #575417) + +* Mon Mar 22 2010 Harald Hoyer 145-17 +- fixed return code of touching the device nodes [FAIL] -> [OK] + +* Wed Mar 17 2010 Harald Hoyer 145-16 +- let cdrom_id use O_EXCL (#566535) +- fix interface rename bug (#531074 #544357) +- remove GPL COPYING file from LGPL subpackages (#536843) +- create /dev/hugepages subdir in start_udev (#541998) +- fix brightness keys on MSI Wind U-100 (#563453) +- fix dangling symlinks (#566680) +- remove erroneous 19d2:2000 modeswitch rule (#569296) +- add firewire video devices (#559581) +- touch all device nodes after udev settled for the timezone + timestamp (#569335) +- removed one modem-modeswitch line (#574949) +- add virtio symlinks + +* Tue Jan 26 2010 Harald Hoyer 145-15 +- removed one modem-modeswitch line (#541686) +- added one modem-modeswitch line (#547759) +- fixed dangling symlinks (#558235) +- fixed initscript (#557771, #523976, +- obsolete DeviceKit (#532961) +- fixed copyright (#536843) + +* Wed Nov 11 2009 Bastien Nocera 145-14 +- Fix blu-ray and hd-dvd drives not getting detected properly + when a medium is absent +- Fix upgrade from Fedora 11 with bluez installed (#533925) + +* Thu Nov 05 2009 Harald Hoyer 145-13 +- obsolete DeviceKit and DeviceKit-devel (#532961) +- add NEWS file to the doc section +- automatically turn on hotplugged CPUs (#523127) +- fixed udev-post exit codes (#523976) +- own directory /lib/udev/keymaps (#521801) +- no more floppy modaliases (#514329) +- added two more modems to modem-modeswitch.rules (#515349) + +* Thu Nov 05 2009 Bastien Nocera 145-12 +- Update hid2hci from udev master, fixes problems with Dell + Bluetooth dongles not working (#532628) + +* Tue Oct 13 2009 Harald Hoyer 145-11 +- recognize a devtmpfs on /dev (bug #528488) + +* Tue Sep 29 2009 Harald Hoyer 145-10 +- add ConsoleKit patch for ConsoleKit 0.4.1 + +* Fri Sep 25 2009 harald@redhat.com 145-9 +- add patches to fix cdrom_id +- add patch to fix the inotify bug (bug #524752) + +* Wed Sep 23 2009 harald@redhat.com 145-8 +- obsolete libgudev and libgudev-devel (bug #523569) + +* Mon Aug 24 2009 Karsten Hopp 145-7 +- drop ifnarch s390x for usbutils, as we now have usbutils for s390x + +* Mon Aug 24 2009 Harald Hoyer 145-6 +- ifnarch s390 for usbutils + +* Tue Aug 04 2009 Harald Hoyer 145-5 +- do not make extra nodes in parallel +- restorecon on /dev + +* Tue Aug 04 2009 Harald Hoyer 145-4 +- --enable-debug +- add patch for timestamps in debugging output + +* Wed Jul 29 2009 Harald Hoyer 145-3 +- add patch from upstream git to fix bug #514086 +- add version to usbutils build requirement + +* Fri Jul 24 2009 Harald Hoyer 145-2 +- fix file permissions +- remove rpath +- chkconfig --add for udev-post +- fix summaries +- add "Required-Stop" to udev-post + +* Tue Jul 14 2009 Harald Hoyer 145-1 +- version 145 +- add "udevlog" kernel command line option to redirect the + output of udevd to /dev/.udev/udev.log + +* Fri Jul 03 2009 Harald Hoyer 143-2 +- add acpi floppy modalias +- add retrigger of failed events in udev-post.init +- killall pids of udev in %%pre + +* Fri Jun 19 2009 Harald Hoyer 143-1 +- version 143 + +* Thu Jun 08 2009 Harald Hoyer 142-4 +- git fix: udevadm: settle - fix timeout +- git fix: OWNER/GROUP: fix if logic +- git fix: rule-generator: cd - skip by-path links if we create by-id links +- git fix: fix possible endless loop for GOTO to non-existent LABEL +- git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain non-writable + CDROM media + +* Thu Jun 08 2009 Harald Hoyer 142-3 +- delay device-mapper changes + +* Fri Jun 05 2009 Bastien Nocera 142-2 +- Rebuild in dist-f12 + +* Fri May 15 2009 Harald Hoyer 142-1 +- version 142 +- no more libvolume_id and vol_id + +* Fri Apr 17 2009 Harald Hoyer 141-3 +- added /dev/fuse creation to start_udev + +* Thu Apr 16 2009 Harald Hoyer 141-2 +- fixed post and pre + +* Tue Apr 14 2009 Harald Hoyer 141-1 +- version 141 + +* Wed Apr 01 2009 Harald Hoyer 139-4 +- double the IMPORT buffer (bug #488554) +- Resolves: rhbz#488554 + +* Wed Apr 01 2009 Harald Hoyer 139-3 +- renamed modprobe /etc/modprobe.d/floppy-pnp to + /etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768) +- Resolves: rhbz#492732 + +* Tue Mar 03 2009 Harald Hoyer 139-2 +- speedup of start_udev by doing make_extra_nodes in parallel to + the daemon start + +* Fri Feb 27 2009 Harald Hoyer 139-1 +- version 139 + +* Wed Feb 25 2009 Fedora Release Engineering - 137-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Feb 05 2009 Harald Hoyer 137-4 +- fixed md change/remove event handling + +* Thu Feb 05 2009 Harald Hoyer 137-3 +- added 5 second sleep for "modprobedebug" to catch bad modules + +* Fri Jan 30 2009 Harald Hoyer 137-2 +- moved groupadd to pre section (bug #483089) + +* Thu Jan 29 2009 Harald Hoyer 137-1 +- version 137 +- add vol_id patches from kzak +- dialout group has gid 18 now + +* Tue Jan 20 2009 Harald Hoyer 136-2 +- added some rule fixes, which will be in udev-137 + +* Tue Jan 20 2009 Harald Hoyer 136-1 +- test for restorecon in start_udev before it is used (bug #480608) +- added groups video audio cdrom tape dialout in post + (might be moved to MAKEDEV) +- version 136 + +* Tue Dec 16 2008 Harald Hoyer 135-3 +- added sepol patch + +* Tue Dec 16 2008 Harald Hoyer 135-2 +- changed udevsettle -> udevadm settle +- added doc to libudev-devel +- added more attr and defattr +- various rpmlint fixes + +* Tue Dec 02 2008 Harald Hoyer 135-1 +- version 135 + +* Wed Nov 19 2008 Harald Hoyer 133-1 +- version 133 + +* Mon Nov 10 2008 Harald Hoyer 132-1 +- version 132 +- added memory stick rules (bug #470096) + +* Thu Oct 16 2008 Harald Hoyer 127-2 +- added 2 patches for md raid vol_id + +* Mon Sep 01 2008 Harald Hoyer 127-1 +- version 127 + +* Fri Aug 08 2008 Harald Hoyer 126-1 +- version 126 +- fixed udevadm syntax in start_udev (credits B.J.W. Polman) +- removed some manually created devices from makedev (bug #457125) + +* Tue Jun 17 2008 Harald Hoyer 124-1.1 +- readded udevcontrol, udevtrigger symlinks for Fedora 9, + which are needed by live-cd-tools + +* Thu Jun 12 2008 Harald Hoyer 124-1 +- version 124 +- removed udevcontrol, udevtrigger symlinks (use udevadm now) + +* Tue Jun 3 2008 Jeremy Katz - 121-2.20080516git +- Add lost F9 change to remove /dev/.udev in start_udev (#442827) + +* Fri May 16 2008 Harald Hoyer 121-1.20080516git +- version 121 + latest git fixes + +* Thu May 07 2008 Harald Hoyer 120-6.20080421git +- added input/hp_ilo_mouse symlink + +* Tue May 06 2008 Harald Hoyer 120-5.20080421git +- remove /dev/.udev in start_udev (bug #442827) + +* Mon Apr 21 2008 Harald Hoyer 120-4.20080421git +- added patches from git: +- persistent device naming: also read unpartitioned media +- scsi_id: initialize serial strings +- logging: add trailing newline to all strings +- path_id: remove subsystem whitelist +- allow setting of MODE="0000" +- selinux: more context settings +- rules_generator: net rules - always add KERNEL== match to generated rules +- cdrom_id: replace with version which also exports media properties +- vol_id: add --offset option +- udevinfo: do not replace chars when printing ATTR== matches +- Resolves: rhbz#440568 + +* Fri Apr 11 2008 Harald Hoyer 120-3 +- fixed pre/preun scriptlets (bug #441941) +- removed fedora specific patch for selinux symlink handling + +* Sat Apr 05 2008 Harald Hoyer 120-2 +- removed warning about deprecated /lib/udev/devices (rhbz#440961) +- replaced /usr/bin/find with shell find function (rhbz#440961) + +* Fri Apr 04 2008 Harald Hoyer 120-1 +- version 120 + +* Mon Mar 17 2008 Harald Hoyer 118-11 +- removed /var/lib/udev/rules.d again + +* Fri Mar 14 2008 Harald Hoyer 118-10 +- turned off MAKEDEV cache, until the generated shell scripts + create new directories + +* Thu Mar 13 2008 Harald Hoyer 118-9 +- added more support for the "modprobedebug" kernel command + line option, to debug hanging kernel modules + +* Thu Mar 13 2008 Harald Hoyer 118-8 +- added /etc/sysconfig/udev to configure some speedups +- added "udevnopersist" as a kernel command line, to disable + persistent storage symlink generation + +* Thu Mar 13 2008 Harald Hoyer 118-7 +- files from /var/lib/udev/rules.d are copied to /dev/.udev/rules.d + at startup and back at shutdown +- persistent cd and net rules generate the files in + /dev/.udev/rules.d now +- added post section to symlink 70-persistent-cd.rules 70-persistent-net.rules + from /etc/udev/rules.d to /dev/.udev/rules.d + +* Thu Mar 13 2008 Harald Hoyer 118-6 +- moved all generated files to /var/lib/udev + (also 70-persistent-cd.rules 70-persistent-net.rules) +- added a caching mechanism for MAKEDEV (saves some seconds on startup) +- added trigger for selinux-policy and MAKEDEV to remove the udev cache files + +* Wed Feb 20 2008 Harald Hoyer 118-4 +- made symlinks relative (rhbz#432878) +- removed the backgrounding of node creation (rhbz#381461) +- do not change sg group ownership to disk for scanners (rhbz#432602) +- attempt to fix selinux symlink bug (rhbz#345071) +- fixed URL +- made rpmlint mostly happy +- disabled static version (no static selinux lib) + +* Mon Feb 18 2008 Fedora Release Engineering - 118-3 +- Autorebuild for GCC 4.3 + +* Wed Jan 09 2008 Harald Hoyer 118-2 +- reenabled static version + +* Tue Jan 08 2008 Harald Hoyer 118-1 +- version 118 +- removed old USB compat rule (rhbz#424331) +- disabled static version + +* Thu Oct 18 2007 Harald Hoyer 116-3 +- fixed preun chkconfig +- added /sbin path to chkconfig in post section +- patch: do not generate net rules for type > 256 +- fixes glitches appearing in bz#323991 + +* Tue Oct 16 2007 Dennis Gilmore 116-2 +- sparc64 requires -fPIE not -fpie + +* Mon Oct 15 2007 Harald Hoyer 116-1 +- version 116 + +* Fri Oct 12 2007 Harald Hoyer 115-5.20071012git +- added upstream patch for rhbz#328691 +- moved floppy module loading to pnp-alias in /etc/modprobe.d/floppy-pnp + +* Wed Oct 10 2007 Harald Hoyer 115-5.20070921git +- better modprobe options for the kernel command line 'modprobedebug' option + +* Fri Sep 21 2007 Harald Hoyer - 115-4 +- more upstream fixes from git + +* Thu Sep 20 2007 Harald Hoyer - 115-3 +- some upstream fixes from git +- removed last_rule for loop rules +- added "udevinfo udevtrace" kernel command line options for better debugging + +* Fri Sep 07 2007 Harald Hoyer - 115-2 +- some upstream fixes from git +- last_rule for loop rules (speedup for live-cds/qemu with 128 loop devices) + +* Thu Aug 24 2007 Harald Hoyer - 115-1 +- version 115 + +* Fri Aug 24 2007 Harald Hoyer - 113-12 +- removed /dev/tape symlink, because it's now a directory + (bug #251755) + +* Thu Aug 23 2007 Harald Hoyer - 114-4 +- added patch to prevent persistent net rules for virtual network interfaces, + like vmware and vlans + +* Thu Aug 23 2007 Harald Hoyer - 114-3 +- changed license tag +- changed to latest upstream rule ordering + +* Thu Aug 16 2007 Harald Hoyer - 113-11 +- readded firmware rule (#252983) + +* Wed Aug 15 2007 Harald Hoyer - 113-10 +- do not run vol_id on non-partition block devices (bug #251401) +- read all multiline pnp modaliases again + +* Mon Aug 13 2007 Harald Hoyer - 114-2 +- fixed isapnp rule (bug #251815) +- fix for nikon cameras (bug #251401) + +* Fri Aug 10 2007 Harald Hoyer - 114-1 +- version 114 +- big rule unification and cleanup +- added persistent names for network and cdrom devices over reboot + +* Wed Aug 08 2007 Harald Hoyer - 113-9 +- added lp* to 50-udev.nodes (#251272) + +* Mon Jul 30 2007 Harald Hoyer - 113-8 +- removed "noreplace" config tag from rules (#250043) + +* Fri Jul 27 2007 Harald Hoyer - 113-7 +- major rule cleanup +- removed persistent rules from 50 and included upstream rules +- removed skip_wait from modprobe + +* Fri Jul 20 2007 Harald Hoyer - 113-6 +- kernel does not provide usb_device anymore, + corrected the rules (#248916) + +* Thu Jul 19 2007 Harald Hoyer - 113-5 +- corrected the rule for usb devices (#248916) + +* Sat Jul 14 2007 Harald Hoyer - 113-4 +- do not collect modprobes (bug #222542), because firmware + loading seems to depend on it. + +* Mon Jul 9 2007 Harald Hoyer - 113-3 +- speedup things a little bit + +* Wed Jun 27 2007 Harald Hoyer - 113-2 +- added more firewire symlinks (#240770) +- minor rule patches + +* Tue Jun 26 2007 Harald Hoyer - 113-1 +- version 113 +- added rule for SD cards in a TI FlashMedia slot (#217070) + +* Tue Jun 26 2007 Harald Hoyer - 106-4.1 +- fixed modprobedebug option +- removed snd-powermac from the default modules (#200585) + +* Wed May 02 2007 Harald Hoyer - 106-4 +- do not skip all events on modprobe (#238385) +- Resolves: rhbz#238385 + +* Fri Apr 27 2007 Harald Hoyer - 106-3 +- modprobe only on modalias (bug #238140) +- make startup messages visible again +- speedup boot process by not executing pam_console_apply while booting +- Resolves: rhbz#238140 + +* Wed Apr 11 2007 Harald Hoyer - 106-2 +- create floppy device nodes with the correct selinux context (bug #235953) +- Resolves: rhbz#235953 + +* Wed Mar 7 2007 Harald Hoyer - 106-1 +- version 106 +- specfile cleanup +- removed pilot rule +- removed dasd_id and dasd_id rule +- provide static versions in a subpackage + +* Wed Feb 21 2007 Harald Hoyer - 105-1 +- version 105 + +* Tue Feb 6 2007 Harald Hoyer - 104-2 +- moved uinput to input subdirectory (rhbz#213854) +- added USB floppy symlinks (rhbz#185171) +- fixed ZIP drive handling (rhbz#223016) +- Resolves: rhbz#213854,rhbz#185171,rhbz#223016 + +* Tue Jan 23 2007 Harald Hoyer - 104-1 +- version 104 +- merged changes from RHEL + +* Wed Dec 6 2006 Harald Hoyer - 103-3 +- changed DRIVER to DRIVERS +- Resolves: rhbz#218160 + +* Fri Nov 10 2006 Harald Hoyer - 103-2 +- changed SYSFS to new ATTR rules +- Resolves: rhbz#214898 + +* Fri Nov 10 2006 Harald Hoyer - 103-1 +- Removed 51-hotplug.rules +- Resolves: rhbz#214277 + +* Wed Oct 11 2006 Harald Hoyer - 095-14 +- skip persistent block for gnbd devices (bug #210227) + +* Wed Oct 4 2006 Harald Hoyer - 095-13 +- fixed path_id script (bug #207139) + +* Tue Oct 3 2006 Jeremy Katz - 095-12 +- autoload mmc_block (#171687) + +* Wed Sep 27 2006 Harald Hoyer - 095-10 +- typo in xpram/slram rule (bug #205563) + +* Mon Sep 25 2006 Harald Hoyer - 095-9 +- improved error msg for firmware_helper (bug #206944) +- added xpram symlink to slram device nodes (bug #205563) +- removed infiniband rules (bug #206224) +- use newest path_id script (bug #207139) + +* Tue Aug 29 2006 Harald Hoyer - 095-8 +- fixed bug #204157 + +* Wed Aug 16 2006 Harald Hoyer - 095-7 +- added udevtimeout= + kernel command line parameters for start_udev + (default is to wait forever) + +* Wed Aug 16 2006 Harald Hoyer - 095-6 +- new speedup patch for selinux (bug #202673) + +* Thu Aug 10 2006 Harald Hoyer - 095-5 +- allow long comments (bug #200244) + +* Mon Aug 7 2006 Harald Hoyer - 095-4 +- fixed CAPI device nodes (bug #139321) +- fixed bug #201422 + +* Wed Jul 12 2006 Harald Hoyer - 095-3 +- more infiniband rules (bug #198501) + +* Wed Jul 12 2006 Jesse Keating - 095-2.1 +- rebuild + +* Thu Jul 6 2006 Harald Hoyer - 095-2 +- added option to debug udev with kernel cmdline option "udevdebug" + +* Wed Jul 5 2006 Harald Hoyer - 095-1 +- version 095 + +* Wed Jun 14 2006 Harald Hoyer - 094-1 +- version 094 + +* Sun May 21 2006 Peter Jones - 092-2 +- Fix typo in pam-console rule + +* Wed May 18 2006 Harald Hoyer - 092-1 +- version 092 +- corrected some rules (bug #192210 #190927) + +* Tue May 09 2006 Harald Hoyer - 091-3 +- corrected some rules (bug #190927) + +* Wed May 03 2006 Harald Hoyer - 091-2 +- added subpackages libvolume_id and libvolume_id-devel + +* Wed May 03 2006 Harald Hoyer - 091-1 +- version 091 + +* Wed Apr 19 2006 Harald Hoyer - 090-1 +- version 090 + +* Thu Apr 13 2006 Harald Hoyer - 089-1 +- version 089 +- do not force loading of parport_pc (bug #186850) +- manually load snd-powermac (bug #176761) +- added usb floppy symlink (bug #185171) +- start_udev uses udevtrigger now instead of udevstart + +* Wed Mar 08 2006 Harald Hoyer - 084-13 +- fixed pam_console rules (#182600) + +* Mon Mar 06 2006 Harald Hoyer - 084-12 +- fixed DRI permissions + +* Sun Mar 05 2006 Bill Nottingham - 084-11 +- use $ENV{MODALIAS}, not $modalias (#181494) + +* Thu Mar 02 2006 Harald Hoyer - 084-10 +- fixed cdrom rule + +* Wed Mar 01 2006 Harald Hoyer - 084-9 +- create non-enum device (cdrom, floppy, scanner, changer) + for compatibility (random device wins) + e.g. /dev/cdrom -> hdd /dev/cdrom-hdc -> hdc /dev/cdrom-hdd -> hdd + +* Wed Mar 01 2006 Harald Hoyer - 084-8 +- fixed ZIP drive thrashing (bz #181041 #182601) +- fixed enumeration (%%e does not work anymore) (bz #183288) + +* Fri Feb 24 2006 Peter Jones - 084-7 +- Don't start udevd in %%post unless it's already running +- Stop udevd before chkconfig --del in %%preun + +* Fri Feb 24 2006 Harald Hoyer - 084-6 +- put back original WAIT_FOR_SYSFS rule + +* Fri Feb 24 2006 Harald Hoyer - 084-5 +- removed WAIT_FOR_SYSFS rule + +* Wed Feb 22 2006 Harald Hoyer - 084-4 +- fixed group issue with vol_id (bz #181432) +- fixed dvb permissions (bz #179993) +- added support for scsi media changer (bz #181911) +- fixed pktcdvd device creation (bz #161268) + +* Tue Feb 21 2006 Florian La Roche - 084-3 +- also output the additional space char as part of the startup message + +* Fri Feb 10 2006 Jesse Keating - 084-1.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Harald Hoyer - 084-1 +- version 084 + +* Mon Feb 06 2006 Harald Hoyer - 078-9 +- closed fd leak (bug #179980) + +* Thu Jan 26 2006 Harald Hoyer - 078-8 +- changed usb device naming + +* Tue Jan 24 2006 Harald Hoyer - 078-7 +- put WAIT_FOR_SYSFS rules in 05-udev-early.rules + +* Mon Jan 23 2006 Harald Hoyer - 078-6 +- added some WAIT_FOR_SYSFS rules +- removed warning message, if udev_db is not available + +* Sun Jan 22 2006 Kristian Høgsberg 078-5 +- Drop udev dependency (#178621). + +* Tue Jan 11 2006 Harald Hoyer - 078-4 +- removed group "video" from the rules +- fixed specfile +- load nvram, floppy, parport and lp modules in + /etc/sysconfig/modules/udev-stw.modules until there + is a better solution +- fixed more floppy module loading + +* Fri Dec 23 2005 Harald Hoyer - 078-3 +- fixed floppy module loading +- added monitor socket +- fixed typo in dvb rule + +* Wed Dec 21 2005 Bill Nottingham - 078-2 +- udevstart change: allow greylisting of certain modaliases (usb, firewire) + +* Wed Dec 21 2005 Harald Hoyer - 078-1 +- version 078 +- fixed symlink to pam_console.dev + +* Thu Dec 15 2005 Harald Hoyer - 077-2 +- switched back to udevstart and use active /dev/.udev/queue waiting + in start_udev +- removed support for old kernels +- refined some udev.rules + +* Mon Dec 13 2005 Harald Hoyer - 077-1 +- version 077 +- patch to include udevstart2 in udevd and delay daemonize until queue is empty + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Tue Dec 06 2005 Harald Hoyer - 076-1 +- speedup udevd with selinux by calling matchpathcon_init_prefix() +- version 076 + +* Mon Nov 21 2005 Harald Hoyer - 075-4 +- speedup udev event replay with udevstart2 + +* Fri Nov 18 2005 Harald Hoyer - 075-3 +- refined start_udev for old kernels + +* Fri Nov 11 2005 Harald Hoyer - 075-2 +- moved /etc/udev/scripts to /lib/udev +- moved /etc/udev/devices to /lib/udev/devices +- added new event replay for kernel >= 2.6.15 +- added usb devices +- renamed cpu device to cpuid (bug #161538) +- changed vendor string "Onstream" to "On[sS]tream" (bug #173043) +- compiled all *_id programs statically + +* Fri Nov 11 2005 Harald Hoyer - 075-1 +- version 075 + +* Tue Oct 25 2005 Harald Hoyer - 071-1 +- version 071 + +* Mon Oct 10 2005 Harald Hoyer - 069-10 +- removed group usb + +* Mon Oct 10 2005 Harald Hoyer - 069-9 +- added libsepol-devel BuildReq +- refined persistent rules + +* Mon Oct 10 2005 Harald Hoyer - 069-8 +- corrected c&p edd_id rule, symlink for js devices +- added -lsepol + +* Thu Oct 06 2005 Harald Hoyer - 069-7 +- added edd_id + +* Fri Sep 30 2005 Harald Hoyer - 069-6 +- special handling of IEEE1394 firewire devices (bug #168093) + +* Fri Sep 23 2005 Harald Hoyer - 069-5 +- added missing path_id + +* Wed Sep 21 2005 Harald Hoyer - 069-4 +- readded volume_id now known as vol_id, bug #168883 + +* Thu Sep 15 2005 Bill Nottingham - 069-3 +- fix firmware loading + +* Wed Sep 14 2005 Bill Nottingham - 069-2 +- own /lib/firmware (#167016) + +* Wed Sep 14 2005 Harald Hoyer - 069-1 +- version 069 + +* Thu Aug 04 2005 Harald Hoyer - 063-6 +- compile with pie .. again... (#158935) +- fixed typo in echo (#138509) + +* Tue Aug 02 2005 Harald Hoyer - 063-5 +- fixed scsi hotplug replay + +* Tue Aug 02 2005 Bill Nottingham - 063-5 +- add rule to allow function id matching for pcmcia after loading + modules (#164665) + +* Tue Aug 02 2005 Harald Hoyer - 063-4 +- fixed typo for tape devices and changed mode to 0660 + +* Thu Jul 28 2005 Harald Hoyer - 063-3 +- changed "SYMLINK=" to "SYMLINK+=" + +* Sun Jul 24 2005 Bill Nottingham - 063-2 +- don't set SEQNUM for scsi replay events (#163729) + +* Tue Jul 19 2005 Bill Nottingham - 063-1 +- update to 063 +- handle the hotplug events for ieee1394, scsi, firmware + +* Fri Jul 08 2005 Bill Nottingham - 062-2 +- update to 062 +- use included ata_id, build usb_id +- load modules for pci, usb, pcmcia +- ship RELEASE-NOTES in %%doc + +* Thu Jul 07 2005 Harald Hoyer - 058-2 +- compile with pie + +* Fri May 20 2005 Bill Nottingham - 058-1 +- update to 058, fixes conflict with newer kernels (#158371) + +* Thu May 12 2005 Harald Hoyer - 057-6 +- polished persistent scripts + +* Thu May 5 2005 Bill Nottingham - 057-5 +- rebuild + +* Thu May 5 2005 Bill Nottingham - 057-4 +- better check for mounted tmpfs on /dev (#156862) + +* Wed Apr 27 2005 Peter Jones - 057-3 +- use udevstart rather than udev for udevstart.static + +* Thu Apr 21 2005 Harald Hoyer - 057-2 +- added Inifiniband devices (bug #147035) +- fixed pam_console.dev (bug #153250) + +* Mon Apr 18 2005 Harald Hoyer - 057-1 +- version 057 + +* Fri Apr 15 2005 Dan Walsh - 056-2 +- Fix SELinux during creation of Symlinks + +* Mon Apr 11 2005 Harald Hoyer - 056-1 +- updated to version 056 +- merged permissions in the rules file +- added udevpermconv.sh to convert old permission files + +* Mon Mar 28 2005 Warren Togami - 050-10 +- own default and net dirs (#151368 Hans de Goede) + +* Mon Mar 07 2005 Warren Togami - 050-9 +- fixed rh#150462 (udev DRI permissions) + +* Wed Mar 02 2005 Harald Hoyer - 050-8 +- fixed rh#144598 + +* Fri Feb 18 2005 Harald Hoyer - 050-6 +- introducing /etc/udev/makedev.d/50-udev.nodes +- glibcstatic patch modified to let gcc4 compile udev + +* Thu Feb 10 2005 Harald Hoyer - 050-5 +- doh, reverted the start_udev devel version, which slipped in + +* Thu Feb 10 2005 Harald Hoyer - 050-3 +- fixed forgotten " in udev.rules + +* Tue Jan 11 2005 Harald Hoyer - 050-2 +- removed /dev/microcode, /dev/cpu/microcode is now the real node +- cleaned up start_udev + +* Tue Jan 11 2005 Harald Hoyer - 050-1 +- version 050 +- /dev/cpu/0/microcode -> /dev/cpu/microcode + +* Tue Dec 21 2004 Dan Walsh - 048-4 +- Call selinux_restore to fix labeling problem in selinux +- Fixes rh#142817 + +* Tue Dec 21 2004 Harald Hoyer - 048-3 +- maybe fixed bug rh#143367 + +* Thu Dec 16 2004 Harald Hoyer - 048-2 +- fixed a case where reading /proc/ide/hd?/media returns EIO + (bug rh#142713) +- changed all device node permissions of group "disk" to 0640 + (bug rh#110197) +- remove $udev_db with -fr in case of a directory (bug rh#142962) + +* Mon Dec 13 2004 Harald Hoyer - 048-1 +- version 048 +- major specfile cleanup + +* Thu Nov 04 2004 Harald Hoyer - 042-1 +- version 042 + +* Thu Nov 04 2004 Harald Hoyer - 039-10 +- speed improvement, scripts in rules are now executed only once, + instead of four times + +* Thu Nov 04 2004 Harald Hoyer - 039-9 +- removed wrong SIG_IGN for SIGCHLD +- moved ide media check to script to wait for the procfs + +* Wed Nov 3 2004 Jeremy Katz - 039-8.FC3 +- recreate lvm device nodes if needed in the trigger (#137807) + +* Wed Nov 03 2004 Harald Hoyer - 039-6.FC3.2 +- replace udev.conf by default +- LANG=C for fgrep in start_udev; turn grep into fgrep + +* Tue Nov 02 2004 Harald Hoyer - 039-6.FC3.1 +- speed up pam_console.dev +- mount pts and shm, in case of the dev trigger +- increased timeout for udevstart +- removed syslog() from signal handler (caused vmware locks) +- turned off logging, which speeds up the boot process * Thu Oct 21 2004 Harald Hoyer - 039-6 - fixed typo @@ -571,7 +1399,7 @@ rm -rf $RPM_BUILD_ROOT when start_udev runs * Thu Sep 02 2004 Harald Hoyer - 030-16 -- moved %{_sysconfdir}/hotplug.d/default/udev.hotplug to %{_sysconfdir}/hotplug.d/default/10-udev.hotplug +- moved %%{_sysconfdir}/hotplug.d/default/udev.hotplug to %%{_sysconfdir}/hotplug.d/default/10-udev.hotplug * Thu Sep 02 2004 Harald Hoyer - 030-15 - added nvidia devices to start_udev diff --git a/udev.sysconfig b/udev.sysconfig new file mode 100644 index 0000000..9a58d98 --- /dev/null +++ b/udev.sysconfig @@ -0,0 +1,4 @@ +# If set to "yes", generates cache shell files of what MAKEDEV would do. +# May speedup some systems with slow disks. +# EXPERIMENTAL - use at your own risk +UDEV_USE_MAKEDEV_CACHE="no" diff --git a/upstream b/upstream new file mode 100644 index 0000000..287b708 --- /dev/null +++ b/upstream @@ -0,0 +1 @@ +udev-145.tar.bz2 diff --git a/upstream-key.gpg b/upstream-key.gpg new file mode 100644 index 0000000..81cd947 --- /dev/null +++ b/upstream-key.gpg @@ -0,0 +1,54 @@ +pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key + Key fingerprint = C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E +sub 4096g/E50A8F2A 2000-10-10 + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.0.3 (GNU/Linux) +Comment: For info see http://www.gnupg.org + +mQGiBDnirDkRBADCTL/iUTeZKb0tiAcKdZdsUP/KSnrGGjlinolUAsUC0D6/hUB1 +RdCpJOOERTIEr1yvehqDM7veRhNMoxJNQxa/sSrkywey5qc8uaskUNEqenimq/70 +bahWJeoWXjad68mQFh65lULnHQrrioeJnh9UpyGJppNb/yIjdnymH9aYEwCglgP7 +UegBzH22h8NVQEK2PWWbyUUD/jQA4lI0wRWcL9HpkYkHcH0LTKRB9zYpQYtyvzJi +yTGwJyFMfYNXy0RT11dICeLkf3HMR84hkPERKMhALobLxVUbfc7j2AygmzGphWGy +DH/xjptQP/zrsq87ylYRONK18w1J42cm+yZa4XThMDPJMrb9/l8qnxU1JnW7W1al +HKTpBACbs+91KLqrnIGcF44TMwxgUj5CUrayPoEnLU+ZMBqfSjmu8RqEYmTxJCKv +7erBFSuazBGj5X7twunrtrW3bxO63MbLbHjfXSRrMnKOb8dRULIg6eWAnoAx8VVZ +YjrOpwAntU3WxYOpbiCHt9kLbb+N5rvNtFcmOqRRQaCIUFOOaLQ8TGludXggS2Vy +bmVsIEFyY2hpdmVzIFZlcmlmaWNhdGlvbiBLZXkgPGZ0cGFkbWluQGtlcm5lbC5v +cmc+iFUEExECABUFAjnirDkDCwoDAxUDAgMWAgECF4AACgkQyGugalF9Dw4MNACe +JiQTyCmQzPGou2cl/RyOXj79kYYAnAsT6xt72hp/PFiywYM9vBsDVv9niQEVAwUQ +OeKwNWx5eAAqlgcFAQEdZgf/Vn2dMKrn8021NhavP0uA3pHGRmdKQ2WJBdLiN2tv +LkpAioZtho+op+xBz8j1zdIJQ/7XWko869KHge2BAFwA8rWDzjtaAWdE0Jo/NiAR +epUwV2FdRRwSxIcNG2CCPyJnfPokRqjdl2z9k2PkwidHSq+2k6JxCWnOcIXChSKf +kHnemtA65ixAlhuxvyN3MPuYs1jAHyDGcyMfomp1qH9tXFQhhyXRrG2eMAfslstC +XGXLcoLN3O2BMR/fG2GlV6kOqGOvoMIW3clVeQLQ9B1yyekKiVY6Vg+CgK5qhg8z +9tjH4f33zzNDwsx1WSCOU/1LIPzFBNbR9QtTF2XmOUfRs4hGBBARAgAGBQI54rBc +AAoJEH2d7s4ry8YhmjsAoMUW9RxfXBSos0A6LwGd+5pXv/MRAKCYFLG2T4GSV+qf +iRsXnrgDHQHD04hGBBARAgAGBQI54rOZAAoJEPKlddweGoeC/+sAoL5f7JF21mRe +Z8VV4nhh7prm+idSAKCMXDWW/tBOeJDYpiEhgyGSGgJJWrkEDQQ54q+cEBAAjRmb +txamcZ9EYsQTnQvVL2l6vY5Rnbc1JDdcyHEV1kH5OwZWqvckL4QgKKBbTQwyB9pC +o0nGK4PkBbrwL0outfHQ5jl9DUzTKIu+asWUyf3fxfUV6j2A6BMo59KNnJzUyJ2+ +B5na6NN8nEqEtmogROtjT8LkOvYwqD4A/5re2vwtie+h5yU6A+JbyGQF6lFxThZj +4WGctBgCcDBqRkPAG8DFFAdeN5SMAArktCYuUGXi2q88EDoOs3Ykw0kB8+ZFECz/ +4/b93so5Wt2hC15cxAJoXFfR3mXHm40EHzMdEublWV4blB2KvFocQC74/H74QPUk +cWlc6EhPodKvcuOfTimDxXaiGNFONUPgNAmCXeVoOapdWpb3x7iOHPwSaXeJSrO9 +fc4GtVjDv90DT2ekK7cvYk8s6B3t7p7W21Xi+hRgrw63B3HElr01gdMZY5XA5ey/ +WmnyBS6LOxXlnVBE+2uSQ+aZHqrLpXcRvq2ZonOziDSE0i940ZvIwlSzn0U5BQWl +9hBDQw78RacYqaFvlpcGiPj75bScB4eemxV6Wdo9mtK0Vrr+9bWScXHEv7did4X+ +7tBWKbA8M+g290OSzjeQBGLuPmbjxzEKH9jcUumzBzzC5x5GFh7On9TLXQ4K/oRT +6QQpS93YrTVbR60G4MKsePWLJmg7IgYUtNdLGjsAAwUP/0aAAq8CmWtourj1XxNY +pFmOAU45d65fPWVadKyF++B+uDyRNYN7HQCqrJ7ddn0sH7OBtlE8yaBYgR0TFly9 +9+LqQO4r4IGCw2TBgA5tKnOWoPGEzvrLeoxR3SnPrKBlDvx6Rr9h3OJ9UV5u/NLh +mCP9iN10gWCGzsWbONc6qD6PugbTur44D6s4CRK9xfliSrtG3GBHW914UKjJeB9s +e3oc1rkmNv39kKcu33w4XVETAj4qpXnwoJvy639dfvnQt1TWFjIt20iP7m+jkT3B +b526uJ5GuJl6r8sm5OYYRs5cLigvUzRZVgYnjjqlRRACx0WcinKK55Li2Pq4qcRV +vSE5Tr3kTUTGxdmy113FbscrhLhesGALv3Hb7jeeWC8jviGEaHppgUumR6v0hsI1 +rZ3K8kCjFRAYV8OKtcEeMqjouArGi5dn0ClmG4lwH4SEdqC/TRNWGG+iVpWf5yCj +9mvtvUhLtl6QjXHLrJdSGyafvqR1EQMJadFt4URvx0M7tqZIcwPUnb+7Oc+J96po +e/EQmnm6rFnTpWz0BbY4mbJC7vUH4JyLs0nlxiKrBjaO9C1DSAKBpjqaga8dQe1Z +kLOI2F7IWFeKV2LaMl+ZvvfWMECNcqNW2fkCuP9Fpz5K+xg21TwovVy93aWKgFL6 +06jK51oQp3fW86xXK9ZGKYqQiEYEGBECAAYFAjnir5wACgkQyGugalF9Dw5M9QCg +hhmHalzWf8B3AVrjPrtrRHA1vlgAn3YRlU5l0V5W1iXvHXQCUHIESpgm +=SZZb +-----END PGP PUBLIC KEY BLOCK-----