Compare commits
280 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6e25c4fd5 | ||
|
|
eeb28fb171 | ||
|
|
61152969f1 | ||
|
|
ba4a0c0ced | ||
|
|
1968477995 | ||
|
|
c03ca5cb95 | ||
|
|
c7c784416a | ||
|
|
ec584eb00a | ||
|
|
1b5f4efe18 | ||
|
|
403d10d45b | ||
|
|
d5e28cedbd | ||
| 14f60d8eee | |||
| 78de653bd9 | |||
|
|
a25fcafdac | ||
| f8770c42af | |||
|
|
f066808f9f | ||
|
|
98e286f417 | ||
|
|
350f832b8b | ||
|
|
9544e4100e | ||
|
|
84034b7edc | ||
|
|
38bb0a1d1c | ||
| 844c25b2ef | |||
|
|
ed8467d2d0 | ||
|
|
ff1bbcac61 | ||
|
|
563c14d0dd | ||
|
|
e32392db41 | ||
|
|
b1ca17ab06 | ||
|
|
fd89784a95 | ||
|
|
12ae6f794f | ||
|
|
d833d3f1d5 | ||
|
|
f788b2db50 | ||
|
|
bd74de9f37 | ||
|
|
6d20cb6d08 | ||
|
|
fa01ff8e9d | ||
|
|
644b709215 | ||
|
|
38424c3316 | ||
|
|
c7f7d69498 | ||
| 11d20dd280 | |||
|
|
4b8c514c5e | ||
|
|
98f3cc06dc | ||
|
|
7867726261 | ||
|
|
0345074c5f | ||
|
|
0d974e5004 | ||
|
|
a8a4eac9ed | ||
|
|
508e6c586f | ||
|
|
aa693300db | ||
|
|
e7834dea17 | ||
|
|
08f8626fe5 | ||
|
|
6f3c896370 | ||
|
|
18ab8dfd4e | ||
|
|
67d1ec9319 | ||
|
|
16c3d8a2e9 | ||
|
|
b88dfa1ae4 | ||
|
|
a97f8f1ef5 | ||
|
|
1e8bee8017 | ||
|
|
186679e9be | ||
|
|
0305ca6ecf | ||
|
|
54b85c77f5 | ||
|
|
7128d2cebc | ||
|
|
70982ca944 | ||
|
|
aad9b436ba | ||
|
|
a2c4251423 | ||
|
|
c54320c2aa | ||
|
|
e162135c18 | ||
|
|
514c411277 | ||
|
|
10373cfe68 | ||
|
|
01f6ec751b | ||
|
|
acceb8edac | ||
|
|
96f20ade11 | ||
|
|
b7eb78ef70 | ||
|
|
78ca30d6e7 | ||
|
|
bf2483e47a | ||
|
|
8bc2a79fab | ||
|
|
238456bb10 | ||
|
|
363e26a66c | ||
|
|
14262589b4 | ||
|
|
1fac5b6c17 | ||
|
|
fafa121247 | ||
|
|
0de73c8761 | ||
|
|
cb52ede995 | ||
|
|
30648cd5cf | ||
|
|
1b14e18140 | ||
|
|
0df45d9402 | ||
|
|
cbc032e671 | ||
|
|
7d4c197cd6 | ||
|
|
9aadd0eaf5 | ||
|
|
77cc6a4be0 | ||
|
|
8ceed97a39 | ||
|
|
9c261920b2 | ||
|
|
300efe54f4 | ||
|
|
01f9c12dac | ||
|
|
98b3b5a9d8 | ||
|
|
9cdf66968a | ||
|
|
8c436454d5 | ||
|
|
c5a016502b | ||
|
|
e238b076d0 | ||
|
|
8fc8ffa952 | ||
|
|
71fa48ad54 | ||
|
|
fbebb54fa5 | ||
|
|
0a45e02b4b | ||
|
|
7276a579d3 | ||
|
|
32d4d659a3 | ||
|
|
b08eedbbbe | ||
|
|
5954cf5860 | ||
|
|
347b9e7b57 | ||
|
|
7f7c2af6bd | ||
|
|
d5ad1a068a | ||
|
|
16c9d87686 | ||
|
|
238417da34 | ||
|
|
381aac3306 | ||
|
|
86664196dc | ||
|
|
288053072e | ||
|
|
0c7e43fa82 | ||
|
|
a89500695c | ||
|
|
3df6869de7 | ||
|
|
b2eb238642 | ||
|
|
838d6f0abc | ||
|
|
d225aa6f07 | ||
|
|
850b10c011 | ||
|
|
0baca8cc28 | ||
|
|
e3118d12c9 | ||
|
|
c02d5e7aa3 | ||
|
|
a3cd1a4969 | ||
|
|
4934a31591 | ||
|
|
0c424bbfe6 | ||
|
|
75c73d28b7 | ||
|
|
06da6a6069 | ||
|
|
2740f62afe | ||
|
|
5df8d65998 | ||
|
|
2e382f6b1e | ||
|
|
fadf33e335 | ||
|
|
618e6f6261 | ||
|
|
98705b9413 | ||
|
|
fb8d91fe42 | ||
|
|
9636bd1e2f | ||
|
|
70dd8819a2 | ||
|
|
084706393f | ||
|
|
f067c6a9e5 | ||
|
|
6771560622 | ||
|
|
608a9a87ba | ||
|
|
b9bcdcb26a | ||
|
|
313008525e | ||
|
|
6e07a04b5d | ||
|
|
74f03f6eef | ||
|
|
5a0a7e049e | ||
|
|
6835307e21 | ||
|
|
43c8550b6c | ||
|
|
7e61e26873 | ||
|
|
5bc3b73e6d | ||
|
|
d8976451b0 | ||
|
|
31f40a010f | ||
|
|
5f733958d4 | ||
|
|
a8b7c5571f | ||
|
|
a4724b996b | ||
|
|
aabb5be520 | ||
|
|
a6ba76f7ea | ||
|
|
2819f21324 | ||
|
|
e0c5f362b6 | ||
|
|
7a83ca4938 | ||
|
|
508c20a9a1 | ||
|
|
5f0c226881 | ||
|
|
e204ad31a5 | ||
|
|
3ecb8f9522 | ||
|
|
67c4ed9f4c | ||
|
|
39ba214178 | ||
|
|
cccc0b3e45 | ||
|
|
d7d38eba96 | ||
|
|
6026b801d4 | ||
|
|
e33d945d10 | ||
|
|
4326637d6c | ||
|
|
91c5ea6ed8 | ||
|
|
100cc6a6c9 | ||
|
|
764b5c7e23 | ||
|
|
208737699c | ||
|
|
dde4b309c0 | ||
|
|
92075f0849 | ||
|
|
a0ba0ae9a3 | ||
|
|
c3c5561cb2 | ||
|
|
c1a67e70a4 | ||
|
|
a4aecd4b45 | ||
|
|
82dd215147 | ||
|
|
5013d06017 | ||
|
|
8f5d2af8dc | ||
|
|
205e54f2c1 | ||
|
|
77b1c4d775 | ||
|
|
35d832f558 | ||
|
|
76aea984e9 | ||
|
|
81b3909c85 | ||
|
|
f70d2d2b2d | ||
|
|
faa7f43302 | ||
|
|
42ddda11e3 | ||
|
|
5a533bf047 | ||
|
|
01f7ae296a | ||
|
|
e7c55fe821 | ||
|
|
6caf5e0273 | ||
|
|
91b0730d35 | ||
|
|
8a99a76aa0 | ||
|
|
30e9fb1b99 | ||
|
|
ad3a3fa524 | ||
|
|
8732912db7 | ||
|
|
cae4d5634d | ||
|
|
ec15aa3500 | ||
|
|
edb32338e6 | ||
|
|
ac0575b898 | ||
|
|
9f3db1c82d | ||
|
|
b088d50d80 | ||
|
|
f0328a5793 | ||
|
|
cda5da2373 | ||
|
|
a6e26500c4 | ||
|
|
d6ea1ff887 | ||
|
|
c0524fbf07 | ||
|
|
7e8bfdbdb2 | ||
|
|
3a22ece851 | ||
|
|
9facb8e38d | ||
|
|
180677a830 | ||
|
|
dece018eeb | ||
|
|
292d9e03b5 | ||
|
|
79d25109ad | ||
|
|
4e926cc718 | ||
|
|
7ec47ce06c | ||
|
|
150d933f5d | ||
|
|
42ba1f491b | ||
|
|
0cdda30aff | ||
|
|
f429dee409 | ||
|
|
cca555da48 | ||
|
|
01ec7ffda3 | ||
|
|
24ef4a4392 | ||
|
|
1bfc08fe69 | ||
|
|
1afddeb410 | ||
|
|
b7f78b31ed | ||
|
|
5fd2c373c6 | ||
|
|
8bc213fad4 | ||
|
|
0420d6c43a | ||
|
|
d3bb620481 | ||
|
|
208f1b3c29 | ||
|
|
f76388842c | ||
|
|
f94df72a6b | ||
|
|
08abd96bc6 | ||
|
|
b674ce74fa | ||
|
|
21237992ed | ||
|
|
ffe870ce74 | ||
|
|
40a19a21df | ||
|
|
a73cdc0aeb | ||
|
|
6ad46f3bf3 | ||
|
|
a0d2b27043 | ||
|
|
14b5ed6ffb | ||
|
|
6e5cd3a635 | ||
|
|
733e59faf9 | ||
|
|
5ce806de29 | ||
|
|
2c74069c8f | ||
|
|
d66c9f1462 | ||
|
|
52a5eda3d7 | ||
|
|
207d787937 | ||
|
|
fd06507230 | ||
|
|
a55305a8ad | ||
|
|
416d2957fb | ||
|
|
69e033e496 | ||
|
|
a96ef60d54 | ||
|
|
64442a64d9 | ||
|
|
327f83d0d1 | ||
|
|
4692a3ff96 | ||
|
|
555529ed2a | ||
|
|
df1892cd11 | ||
|
|
31a721f2cc | ||
|
|
60f8a02e24 | ||
|
|
cd5a71c39f | ||
|
|
4bd4bcf89d | ||
|
|
5a7d228655 | ||
|
|
a5c19a95ea | ||
|
|
132296ce1c | ||
|
|
a86cd2527c | ||
|
|
365c82c995 | ||
|
|
4c18a67274 | ||
|
|
a48e079ae6 | ||
|
|
ca08dd8bf1 | ||
|
|
b84222682c | ||
|
|
ef3022c468 | ||
|
|
3fcf0b0030 | ||
|
|
616a8ffbbb | ||
|
|
76b7bdc383 |
50 changed files with 6389 additions and 473 deletions
|
|
@ -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
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
udev-145.tar.bz2
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
From 7505831b7ee7b04d84424d2ed306a76abd32871c Mon Sep 17 00:00:00 2001
|
||||
From: David Zeuthen <davidz@redhat.com>
|
||||
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 <davidz@redhat.com>
|
||||
---
|
||||
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
|
||||
|
||||
117
0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch
Normal file
117
0001-enumeration-move-ALSA-control-devices-to-the-end-of-.patch
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
From 1dc0ee343df6b6e2ce0591ff08a0aeae2aa2196f Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
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
|
||||
|
||||
72
0002-udevd-add-timestamp-to-debug-output.patch
Normal file
72
0002-udevd-add-timestamp-to-debug-output.patch
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
From 4db7e84ad817944c624256b310d44bd888121c8e Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <time.h>
|
||||
#include <getopt.h>
|
||||
#include <dirent.h>
|
||||
+#include <sys/time.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/signalfd.h>
|
||||
@@ -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
|
||||
|
||||
49
0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch
Normal file
49
0003-fix-wrong-parameter-size-on-ioctl-FIONREAD.patch
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
From 7766066b221302d75002cd5d5a021281388ee56c Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Church <gentoo4@achurch.org>
|
||||
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 <zzam@gentoo.org> 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
|
||||
|
||||
38
0004-fix-single-session-CD-detection.patch
Normal file
38
0004-fix-single-session-CD-detection.patch
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
From 36b35c884fc06bc2babf0ec840cb423b94a45f93 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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
|
||||
|
||||
26
0005-fix-previous-commit-for-CD-detection.patch
Normal file
26
0005-fix-previous-commit-for-CD-detection.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
From a09ac6a6ae39512fafe9df331a311113d2a1d9f6 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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
|
||||
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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
|
||||
|
||||
24
0048-cdrom_id-remove-debugging-code.patch
Normal file
24
0048-cdrom_id-remove-debugging-code.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
From 36a07a8c34a4cff5ad2bbb6e0fdfed49e8191661 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
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
|
||||
|
||||
53
0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch
Normal file
53
0049-cdrom_id-retry-to-open-the-device-if-EBUSY.patch
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
From cccfffbe04c01be12fb42cb12f3f7aa5e2a22dd4 Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
+#include <time.h>
|
||||
#include <scsi/sg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -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
|
||||
|
||||
55
0050-cdrom_id-check-mount-state-in-retry-loop.patch
Normal file
55
0050-cdrom_id-check-mount-state-in-retry-loop.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
From d45c8c8b01c99180f15e24b22f7cf81eaf3cdd1b Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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
|
||||
|
||||
|
|
@ -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"
|
||||
131
0062-cdrom_id-Fix-uninitialized-variables.patch
Normal file
131
0062-cdrom_id-Fix-uninitialized-variables.patch
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
From 816e6bf0fb0849d03696a4b4ec2334e35e819425 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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
|
||||
|
||||
82
0065-cdrom_id-Fix-uninitialized-buffers.patch
Normal file
82
0065-cdrom_id-Fix-uninitialized-buffers.patch
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
From 2b861dc92757b9a3214c2b8e9d8b1c3f3c162391 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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
|
||||
|
||||
88
0066-cdrom_id.patch
Normal file
88
0066-cdrom_id.patch
Normal file
|
|
@ -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 <kay.sievers@vrfy.org>
|
||||
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
|
||||
*
|
||||
* 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
|
||||
|
||||
277
0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch
Normal file
277
0067-cdrom_id-rework-feature-profiles-buffer-parsing.patch
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
From 0413a47ebfcd46ae43cb56ad508b2484bc97ff14 Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <ignored>\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 <ignored>, 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
|
||||
|
||||
121
0068-cdrom_id-print-more-debug-messages.patch
Normal file
121
0068-cdrom_id-print-more-debug-messages.patch
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
From 2e9df1981833e1e029b7ce6c12a44dffb6aad0cb Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <ignored>, 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 <ignored>\n", cur_profile);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
--
|
||||
1.7.0.1
|
||||
|
||||
25
0069-cdrom_id-debug-print-feature-values-in-hex.patch
Normal file
25
0069-cdrom_id-debug-print-feature-values-in-hex.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From 140647ad1aec50e2f657e7838e893a87404ff83a Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <ignored>, with %i bytes\n", feature, features[i+3]);
|
||||
+ info(udev, "GET CONFIGURATION: feature 0x%04x <ignored>, with 0x%02x bytes\n", feature, features[i+3]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
--
|
||||
1.7.0.1
|
||||
|
||||
25
0070-cdrom_id-debug-print-feature-values-in-hex.patch
Normal file
25
0070-cdrom_id-debug-print-feature-values-in-hex.patch
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
From a60b077a465b19af2efd9bf0cb5f0f67117be780 Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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
|
||||
|
||||
79
0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch
Normal file
79
0071-cdrom_id-Do-not-ignore-errors-from-scsi_cmd_run.patch
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
From 58e178894bfc040834e1270c6fe9b9fdef513550 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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 <mike@brudevold.com> 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
|
||||
|
||||
38
0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch
Normal file
38
0072-cdrom_id-Swap-media-state-and-TOC-info-probing.patch
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
From 30e3b1a0d3a3ec76f16736470dc656744848d941 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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
|
||||
|
||||
36
0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch
Normal file
36
0074-cdrom_id-add-missing-profiles-to-feature_profiles.patch
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
From 7c07740ce7b0941844b15573449a730283d5bba5 Mon Sep 17 00:00:00 2001
|
||||
From: Mike Brudevold <mike@brudevold.com>
|
||||
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 <mike@brudevold.com>
|
||||
---
|
||||
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
|
||||
|
||||
183
0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch
Normal file
183
0075-cdrom_id-set-ID_CDROM_MEDIA-1-only-for-known-media.patch
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
From bc913ce47821ed030437ec9b25507b5dd52b59cb Mon Sep 17 00:00:00 2001
|
||||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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 <mike@brudevold.com> 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 <ignored>
|
||||
...
|
||||
|
||||
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
|
||||
|
||||
26
0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch
Normal file
26
0110-cdrom_id-only-mark-sr-0-9-as-ID_CDROM.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
From 155e313bfda594b3d8e2a31d48f341765bdfa75d Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
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
|
||||
|
||||
6
Makefile
6
Makefile
|
|
@ -1,6 +0,0 @@
|
|||
# Makefile for source rpm: udev
|
||||
# $Id$
|
||||
NAME := udev
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
include ../common/Makefile.common
|
||||
6
Makefile.git
Normal file
6
Makefile.git
Normal file
|
|
@ -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
|
||||
|
||||
295
ck-runseat.patch
Normal file
295
ck-runseat.patch
Normal file
|
|
@ -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 <kay.sievers@vrfy.org>
|
||||
*
|
||||
* 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 {
|
||||
25
fw_unit_symlinks.sh
Normal file
25
fw_unit_symlinks.sh
Normal file
|
|
@ -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
|
||||
624
hid2hci.patch
Normal file
624
hid2hci.patch
Normal file
|
|
@ -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 <marcel@holtmann.org>
|
||||
+ * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
|
||||
+ * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
|
||||
*
|
||||
- * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
|
||||
- * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
|
||||
+ * 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 <config.h>
|
||||
-#endif
|
||||
-
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -33,79 +28,24 @@
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/ioctl.h>
|
||||
-
|
||||
+#include <linux/hiddev.h>
|
||||
#include <usb.h>
|
||||
|
||||
-#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;
|
||||
}
|
||||
|
||||
1
mirrors
Normal file
1
mirrors
Normal file
|
|
@ -0,0 +1 @@
|
|||
ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/
|
||||
3
sources
3
sources
|
|
@ -1,2 +1 @@
|
|||
b9b6de70e26abb02c026296e9fbea25b pam_console_setowner-1.4.tgz
|
||||
8a248b0c672e06b9c399c6e31471c922 udev-039.tar.gz
|
||||
b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2
|
||||
|
|
|
|||
369
start_udev
369
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/console
|
||||
fi
|
||||
|
||||
. /etc/init.d/functions
|
||||
. /etc/sysconfig/udev
|
||||
|
||||
prog=udev
|
||||
bin=/sbin/udev
|
||||
udevd=/sbin/udevd
|
||||
MAKEDEV="/sbin/MAKEDEV"
|
||||
|
||||
# Check SELinux status
|
||||
selinuxfs="$(fstab_decode_str `LC_ALL=C awk '/ selinuxfs / { print $2 }' /proc/mounts`)"
|
||||
SELINUX_STATE=
|
||||
if [ -n "$selinuxfs" ] && [ "`cat /proc/self/attr/current`" != "kernel" ]; then
|
||||
if [ -r "$selinuxfs/enforce" ] ; then
|
||||
SELINUX_STATE=`cat "$selinuxfs/enforce"`
|
||||
else
|
||||
# assume enforcing if you can't read it
|
||||
SELINUX_STATE=1
|
||||
fi
|
||||
fi
|
||||
|
||||
touch_recursive() {
|
||||
( cd $1;
|
||||
for i in *; do
|
||||
[[ -c "$i" || -b "$i" ]] && touch --no-create "$i"
|
||||
[ -d "$i" ] && touch_recursive "$i"
|
||||
done )
|
||||
return 0
|
||||
}
|
||||
|
||||
xargs_simple () {
|
||||
if [ "$1" = "-n" ]; then
|
||||
shift
|
||||
MAXNR="$1"
|
||||
shift
|
||||
else
|
||||
MAXNR=100
|
||||
fi
|
||||
NR=$MAXNR
|
||||
ARGS=""
|
||||
[ -z "$1" ] && set echo
|
||||
|
||||
while read line; do
|
||||
if [ $NR -gt 0 ]; then
|
||||
ARGS="$ARGS $line"
|
||||
NR=$[$NR - 1]
|
||||
else
|
||||
"$@" $ARGS
|
||||
NR=$MAXNR
|
||||
ARGS="$line"
|
||||
fi
|
||||
done
|
||||
if [ -n "$ARGS" ]; then
|
||||
"$@" $ARGS
|
||||
fi
|
||||
}
|
||||
|
||||
make_extra_nodes () {
|
||||
ln -snf /proc/self/fd $udev_root/fd
|
||||
ln -snf /proc/self/fd/0 $udev_root/stdin
|
||||
|
|
@ -44,56 +99,78 @@ make_extra_nodes () {
|
|||
ln -snf /proc/self/fd/2 $udev_root/stderr
|
||||
ln -snf /proc/kcore $udev_root/core
|
||||
|
||||
[ -d $udev_root/pts ] || (mkdir $udev_root/pts;chmod 0755 $udev_root/pts)
|
||||
[ -d $udev_root/shm ] || (mkdir $udev_root/shm;chmod 0755 $udev_root/shm)
|
||||
[ -d $udev_root/pts ] || mkdir -m 0755 $udev_root/pts
|
||||
[ -d $udev_root/shm ] || mkdir -m 0755 $udev_root/shm
|
||||
[ -d $udev_root/hugepages ] || mkdir -m 0755 $udev_root/hugepages
|
||||
[ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
|
||||
|
||||
if [ -x $MAKEDEV ]; then
|
||||
$MAKEDEV -x $(
|
||||
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
||||
echo cpu/$i/microcode;
|
||||
done;
|
||||
for i in 1 2 3 4 5 6; do echo tty$i;done;
|
||||
for i in 0 1 2 3 4 5 6 7; do echo loop$i; done;
|
||||
for i in 0 1 2 3; do echo lp$i; echo parport$i;done;
|
||||
echo net/tun ppp console null zero;
|
||||
);
|
||||
[ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
|
||||
cp -a /etc/udev/devices/* /dev/ >/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 >/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
|
||||
|
|
|
|||
8
udev-141-cpu-online.patch
Normal file
8
udev-141-cpu-online.patch
Normal file
|
|
@ -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'"
|
||||
298
udev-145-cdrom_id-backport.patch
Normal file
298
udev-145-cdrom_id-backport.patch
Normal file
|
|
@ -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);
|
||||
|
||||
14
udev-145-floppy.patch
Normal file
14
udev-145-floppy.patch
Normal file
|
|
@ -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
|
||||
638
udev-145-hid2hci-backport.patch
Normal file
638
udev-145-hid2hci-backport.patch
Normal file
|
|
@ -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 <marcel@holtmann.org>
|
||||
+ * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
|
||||
+ * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
|
||||
*
|
||||
- * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
|
||||
- * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
|
||||
+ * 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 <config.h>
|
||||
-#endif
|
||||
-
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -33,79 +28,24 @@
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/ioctl.h>
|
||||
-
|
||||
+#include <linux/hiddev.h>
|
||||
#include <usb.h>
|
||||
|
||||
-#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
|
||||
1026
udev-145-keymap-backport.patch
Normal file
1026
udev-145-keymap-backport.patch
Normal file
File diff suppressed because it is too large
Load diff
18
udev-145-modem-modeswitch.patch
Normal file
18
udev-145-modem-modeswitch.patch
Normal file
|
|
@ -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"
|
||||
20
udev-145-rename.patch
Normal file
20
udev-145-rename.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
commit 6068553195f43a2fd7987c48178de23b63a09f15
|
||||
Author: Harald Hoyer <harald@redhat.com>
|
||||
Date: Fri Sep 18 13:14:30 2009 +0200
|
||||
|
||||
rename interfaces to <iface>_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",
|
||||
|
|
@ -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"
|
||||
34
udev-147-virtio.patch
Normal file
34
udev-147-virtio.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
commit 25728ea1ad0c128ae504801abf1f6bfaab608d93
|
||||
Author: Amit Shah <amit.shah@redhat.com>
|
||||
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 <amit.shah@redhat.com>
|
||||
|
||||
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"
|
||||
96
udev-post.init
Normal file
96
udev-post.init
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# udev-post Post script for udev, after all filesystems are mounted
|
||||
#
|
||||
# Authors: Harald Hoyer <harald@redhat.com>
|
||||
#
|
||||
# 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
|
||||
55
udev.git-38a3cde11bc77af49a96245b8a8a0f2b583a344c.patch
Normal file
55
udev.git-38a3cde11bc77af49a96245b8a8a0f2b583a344c.patch
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
From: Kay Sievers <kay.sievers@vrfy.org>
|
||||
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);
|
||||
34
udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch
Normal file
34
udev.git-d7e2d38c1f0ead2239808dd117577a99a3ad3cde.patch
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
From: Martin Pitt <martin.pitt@ubuntu.com>
|
||||
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"
|
||||
29
udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch
Normal file
29
udev.git-fa0612104ad30d4228aa7782308a77e21b7f6fb5.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
From: Marco d'Itri <md@linux.it>
|
||||
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"
|
||||
|
||||
4
udev.sysconfig
Normal file
4
udev.sysconfig
Normal file
|
|
@ -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"
|
||||
1
upstream
Normal file
1
upstream
Normal file
|
|
@ -0,0 +1 @@
|
|||
udev-145.tar.bz2
|
||||
54
upstream-key.gpg
Normal file
54
upstream-key.gpg
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key <ftpadmin@kernel.org>
|
||||
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-----
|
||||
Loading…
Add table
Add a link
Reference in a new issue