Compare commits

..

362 commits

Author SHA1 Message Date
Kay Sievers
ce9320b04b obsolete udev, it is replaced by systemd 2012-07-11 14:28:30 +02:00
Kay Sievers
a07cb8f5f4 drop dependency on specific udev daemon verison 2012-05-24 22:51:05 +02:00
Harald Hoyer
38609fdb7f udev-182-2
- removed s390 rules
2012-03-27 16:54:27 +02:00
Kay Sievers
b59133e5f9 version 182 2012-03-18 20:30:37 +01:00
Kay Sievers
1fcd4845c9 rebuild with fixed binutils 2012-02-09 13:08:07 +01:00
Kay Sievers
d138c6fc55 version 181 2012-02-07 02:11:38 +01:00
Kay Sievers
9646fdce3a test building with filesystem guard 2012-02-03 11:36:31 +01:00
Kay Sievers
90bdfa8bcd install everything in /usr 2012-01-29 18:36:10 +01:00
Kay Sievers
17aa1fb443 version 180 2012-01-29 18:20:56 +01:00
Kay Sievers
e0bc75be11 use %{_sbindir} now that everything is in /usr 2012-01-25 19:42:51 +01:00
Harald Hoyer
36b9856624 increment release 2012-01-25 15:42:00 +01:00
Kay Sievers
dc3e663505 install everything in /usr
This patch is needed for the /usr-move feature
https://fedoraproject.org/wiki/Features/UsrMove

This package requires now 'filesystem' >= 3, which is only installable
on a system which has /bin, /sbin, /lib, /lib64 as symlinks to /usr and
not regular directories. The 'filesystem' package acts as a guard, to
prevent *this* package to be installed on old unconverted systems.

New installations will have the 'filesystem' >=3 layout right away, old
installations need to be converted with anaconda or dracut first; only
after that, the 'filesystem' package, and also *this* package can be
installed.

Packages *should* not install files in /bin, /sbin, /lib, /lib64, but
only in the corresponding directories in /usr. Packages *must* not
install conflicting files with the same names in the corresponding
directories in / and /usr. Especially compatibilty symlinks must not be
installed.

Feel free to modify any of the changes to the spec file, but keep the
above in mind.
2012-01-25 15:29:56 +01:00
Kay Sievers
f110253ee5 work around broken upstream tarball's 'xslt' ifdef 2012-01-25 15:02:58 +01:00
Kay Sievers
e0eeb8a6eb require 'kmod-devel' instead of 'kmod-libs' 2012-01-25 14:47:02 +01:00
Kay Sievers
faded2be30 version 179 2012-01-25 14:25:19 +01:00
Dennis Gilmore
27412d3df2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild 2012-01-14 01:25:45 -06:00
Kay Sievers
f9c13ce3bf version 175 2011-11-08 01:46:54 +01:00
Kay Sievers
4dfe0853b6 ignore entire rule when a key is unknown 2011-10-22 22:06:39 +02:00
Kay Sievers
9653945ff2 update dracut requirement, include entire /lib/udev directory 2011-10-20 13:55:54 +02:00
Kay Sievers
2d66943d2f fix version in changelog 2011-10-20 00:24:46 +02:00
Kay Sievers
2618aa966e version 174 2011-10-19 21:22:11 +02:00
Daniel Drake
5fd2aaff27 Update OLPC XO keymap 2011-08-29 14:39:36 +01:00
Harald Hoyer
08ec76712b version 173
udev-acl functionality is in systemd
2011-08-01 13:21:13 +02:00
Harald Hoyer
c28cf5922c removed loop devices (should be compiled in the kernel)
removed deprecated directories
removed scsi_id symlink
cleanup of requirements
2011-07-20 13:58:40 +02:00
Harald Hoyer
6ae88f0d84 removed loop devices (should be compiled in the kernel)
removed deprecated directories
2011-07-20 13:50:03 +02:00
Harald Hoyer
c48bf88aea removed loop devices (should be compiled in the kernel) 2011-07-20 13:29:29 +02:00
Harald Hoyer
0c6edc1da2 version 172 2011-07-11 15:12:16 +02:00
Harald Hoyer
27c9ba33fe build without introspection
removed unused dirs
added ConsoleKit dirs
2011-06-20 10:27:09 +02:00
Ville Skyttä
2443122e5f udev.spec: own the ConsoleKit and ConsoleKit/run-seat.d dirs
If udev does not actually require ConsoleKit, the dependency should not
be added just for dir ownership, instead the dirs should be owned in
udev which is what the patch does.

http://fedoraproject.org/wiki/Packaging/Guidelines#File_and_Directory_Ownership

https://bugzilla.redhat.com/show_bug.cgi?id=710781
2011-06-20 10:23:17 +02:00
Harald Hoyer
3643fbe9e5 udev.spec: remove introspection and unneeded dirs 2011-06-20 10:22:00 +02:00
Harald Hoyer
f9e3401ad5 version 171 2011-05-27 11:18:48 +02:00
Harald Hoyer
3ad6199da3 version 170
removed /sbin/start_udev
2011-05-20 14:53:29 +02:00
Harald Hoyer
60836322f1 version 170
removed /sbin/start_udev
2011-05-20 14:45:08 +02:00
Harald Hoyer
e70c43125b version 170
removed /sbin/start_udev
2011-05-20 14:40:12 +02:00
Harald Hoyer
83891f6381 - more selinux fixes 2011-04-11 12:15:57 +02:00
Harald Hoyer
3bc0c66b99 Merge remote branch 'origin/f15/master' 2011-04-08 10:05:50 +02:00
Harald Hoyer
b52809d0de udev.spec: untabify 2011-04-08 10:05:10 +02:00
Adam Williamson
cef722535f selinux_label.patch: don't label files outside of /dev 2011-04-07 17:19:42 -07:00
Harald Hoyer
8df68695ff Merge branch 'f15/master' 2011-03-31 18:32:08 +02:00
Harald Hoyer
58624e426e udev.spec: removed gtk-doc 2011-03-31 18:30:08 +02:00
Harald Hoyer
cbf7ac132c removed libxslt buildreq and touch man pages, to prevent rebuild 2011-03-31 18:29:20 +02:00
Harald Hoyer
8cf0c7defa - fixed udev-trigger.service 2011-03-31 18:17:55 +02:00
Harald Hoyer
0b0304cfe1 - fixed udev-trigger.service 2011-03-31 17:58:51 +02:00
Harald Hoyer
21ab835136 removed libxslt buildreq and touch man pages, to prevent rebuild 2011-03-30 17:36:11 +02:00
Harald Hoyer
90347b2001 - version 167 2011-03-30 17:29:32 +02:00
Harald Hoyer
7d03ac0923 - version 167 2011-03-30 17:29:25 +02:00
Harald Hoyer
9ecfc0140b - version 167 2011-03-30 17:18:01 +02:00
Harald Hoyer
a8dfb502d8 - version 167 2011-03-30 16:50:28 +02:00
Harald Hoyer
545bd16ca5 - add ACLs for harmony remote controls
Resolves: rhbz#559412
- fixed CDROM profile handling
2011-03-23 13:36:44 +01:00
Harald Hoyer
99318e91b4 - add ACLs for harmony remote controls
Resolves: rhbz#559412
- fixed CDROM profile handling
2011-03-23 13:35:43 +01:00
Harald Hoyer
400c0eaaaa - renamed udev-post initscript to udev-retry to match
upstream systemd service name
- version 166
2011-02-16 18:41:21 +01:00
Harald Hoyer
57a491c1af - renamed udev-post initscript to udev-retry to match
upstream systemd service name
- version 166
2011-02-16 18:27:27 +01:00
Dennis Gilmore
61095fb1d9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild 2011-02-07 17:57:39 -06:00
Harald Hoyer
243a0734e5 - fixed: network device renaming 2-step exceeds IFNAMSIZ
Resolves: rhbz#673675
2011-02-02 18:59:23 +01:00
Harald Hoyer
c67280da85 - fixed: network device renaming 2-step exceeds IFNAMSIZ
Resolves: rhbz#673675
2011-02-02 18:35:54 +01:00
Harald Hoyer
863c17e8e2 - fixed: network device renaming 2-step exceeds IFNAMSIZ
Resolves: rhbz#673675
2011-02-02 18:35:27 +01:00
Harald Hoyer
ad72e1d944 udev.spec: removed MAKEDEV symlink 2010-12-06 10:20:50 +01:00
Harald Hoyer
15fa57fca0 udev.spec: fixed pre/post udev kill loop 2010-12-06 09:52:36 +01:00
Bastien Nocera
3f6713d0df - Add patches to fix touchpad toggle key handling 2010-11-25 16:05:53 +00:00
Harald Hoyer
9a010ac3e5 - add ACLs for PDA devices
Resolves: rhbz#642435
2010-11-12 15:49:43 +01:00
Harald Hoyer
1efa3f58ce - enlarged the import buffer to fix the ressize bugs
Resolves: rhbz#652318
2010-11-12 15:29:16 +01:00
Harald Hoyer
dfa8b8fed2 - do not create mount point dirs in /dev 2010-11-12 14:20:37 +01:00
Harald Hoyer
3ce9b85314 - version 164
- skip start_udev with systemd
2010-10-29 10:56:18 +02:00
Harald Hoyer
8fcb6e53ed - version 164
- skip start_udev with systemd
2010-10-29 10:55:52 +02:00
Jesse Keating
94c7d90643 - Rebuilt for gcc bug 634757 2010-09-29 15:24:41 -07:00
Matthias Clasen
d8bca2a5df Rebuild 2010-09-21 20:18:19 -04:00
Harald Hoyer
b11538a6c7 - bugfixes for systemd service files
- bugfix for selinux labeling
- bugfixes for cdrom_id
2010-09-01 11:26:01 +02:00
Harald Hoyer
d2cb40f302 - udev-161 with an upstream quirk for the qemu cdrom and
more cdrom handling bugfixes
Resolves: rhbz#609049 rhbz#624286
- added floppy group
Resolves: rhbz#620814
2010-08-17 11:45:34 +02:00
Fedora Release Engineering
cd22a06c9a dist-git conversion 2010-07-29 14:38:21 +00:00
Harald Hoyer
9c03079ed4 - make loop block device again 2010-07-20 13:21:05 +00:00
Harald Hoyer
48e3b21647 - turn off hotplug in /sys/kernel/uevent_helper or /proc/sys/kernel/hotplug 2010-07-20 11:31:27 +00:00
Harald Hoyer
2576ac70df - add versioned requires for libudev to udev 2010-07-15 06:32:02 +00:00
120363a388 - update paths to arch-specific rules 2010-07-14 08:39:36 +00:00
Lennart Poettering
1fbe74e970 Comment systemd-install for now as long as sysinit is not split into pieces 2010-07-13 20:07:15 +00:00
Lennart Poettering
8e5a749a3e Update systemd-install lines to use --realize instead of --start (which got
renamed in systemd)
2010-07-13 19:54:32 +00:00
Lennart Poettering
ef9ccbd582 fix my email address 2010-07-13 19:41:07 +00:00
Lennart Poettering
bc17ac23b4 Don't require systemd .pc file 2010-07-13 19:40:37 +00:00
Harald Hoyer
29c9ccefc5 - version 160
- add systemd service files
- fixed COPYRIGHT files
2010-07-13 19:19:47 +00:00
Harald Hoyer
fda0e26b46 - moved udev pkgconfig to base file on authors request
- specfile cleanups
2010-06-25 13:33:19 +00:00
Harald Hoyer
cb30ef5c02 - version 158 2010-06-24 12:01:42 +00:00
Harald Hoyer
84bd1b90a3 - cleaned up start_udev and udev-post initscript
- removed redhat specific rules
- removed all the makedev.d stuff, udevd now natively supports
    /lib/udev/devices
- added basic devices in /lib/udev/devices
2010-05-27 09:31:37 +00:00
Harald Hoyer
7b608d10c8 - version 156 2010-05-25 12:09:05 +00:00
Harald Hoyer
8ead087df8 - version 154 2010-05-12 14:41:26 +00:00
Harald Hoyer
31132ed7f5 - version 153 2010-04-27 10:29:33 +00:00
Harald Hoyer
9e1428cd3e - pre release of version 152 2010-04-13 15:17:30 +00:00
Harald Hoyer
0d812c700e - pre release of version 152 2010-04-13 15:09:40 +00:00
Harald Hoyer
89b0f29d8b - only correct the timestamp, if UTC=="no" 2010-03-22 14:25:24 +00:00
Harald Hoyer
db587cb8c2 - touch with "--no-create", will not use open() and trigger devs/watchdogs
(bug #575417)
2010-03-22 13:34:41 +00:00
Harald Hoyer
a444fba280 - fixed return code of touching the device nodes [FAIL] -> [OK] 2010-03-22 10:08:46 +00:00
Harald Hoyer
1bb5602ec7 - add "-D" to gperf call 2010-03-19 13:24:17 +00:00
Harald Hoyer
ad37a7c965 add "-D" to gperf call 2010-03-19 13:20:44 +00:00
Harald Hoyer
977de72a58 - add patch for virtio-ports (#569700)
- own libgudev dirs (#561319)
- minor udev startup script improvements (#549518)
- create /dev/hugepages subdir in start_udev (#541998)
- remove GPL COPYING file from LGPL subpackages (#536843)
- removed symlinks to udevadm
- touch all device nodes after udev settled for the timezone timestamp
    (#569335)
- add some upstream bugfixes
2010-03-19 12:48:14 +00:00
Harald Hoyer
52b32c5a0d - udev-86a7a2f-fix-missing-firmware.patch: fix hang when loading microcode
(since microcode_intel tries to probe firmware which does not exist.
    *sigh*)
2010-02-09 09:59:25 +00:00
Harald Hoyer
e0288040af - version 151
- fixed udev-post initscript
- only require s390utils-base, rather than s390utils (#553156)
2010-01-29 09:57:03 +00:00
Harald Hoyer
bcb2d05c81 - version 151
- fixed udev-post initscript
- only require s390utils-base, rather than s390utils (#553156)
2010-01-27 15:44:40 +00:00
Bill Nottingham
7ff3775e4d Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 22:52:46 +00:00
Harald Hoyer
f4ef922fde - require s390utils, because it's essential on s390 2009-11-24 11:26:19 +00:00
Harald Hoyer
c82df992b8 - version 147
- Fix upgrade from Fedora 11 with bluez installed (#533925)
- obsolete DeviceKit and DeviceKit-devel (#532961)
- fixed udev-post exit codes (#523976)
- own directory /lib/udev/keymaps (#521801)
- no more floppy modaliases (#514329)
- added one more modems to modem-modeswitch.rules (#515349)
- add NEWS file to the doc section
- automatically turn on hotplugged CPUs (rhbz#523127)
- recognize a devtmpfs on /dev (bug #528488)
2009-11-12 10:11:06 +00:00
Harald Hoyer
93b6fcbee7 - version 147
- Fix upgrade from Fedora 11 with bluez installed (#533925)
- obsolete DeviceKit and DeviceKit-devel (#532961)
- fixed udev-post exit codes (#523976)
- own directory /lib/udev/keymaps (#521801)
- no more floppy modaliases (#514329)
- added one more modems to modem-modeswitch.rules (#515349)
- add NEWS file to the doc section
- automatically turn on hotplugged CPUs (rhbz#523127)
- recognize a devtmpfs on /dev (bug #528488)
2009-11-12 09:58:24 +00:00
Harald Hoyer
4152795a09 - pre 147
- database format changed
- lots of potential buffer overflow fixes
2009-10-09 10:48:57 +00:00
Harald Hoyer
401942f50d - add ConsoleKit patch for ConsoleKit 0.4.1 2009-09-29 13:09:11 +00:00
Harald Hoyer
38fd08cab9 - add patches to fix cdrom_id
- add patch to fix the inotify bug (bug #524752)
2009-09-25 17:05:23 +00:00
Harald Hoyer
da9416e2a2 - obsolete libgudev and libgudev-devel (bug #523569) 2009-09-23 17:27:00 +00:00
ad3d6b6260 - drop ifnarch s390x for usbutils, as we now have usbutils for s390x 2009-08-24 15:19:15 +00:00
Harald Hoyer
468c4865b8 - ifnarch s390 for usbutils
Tue Aug 04 2009 Harald Hoyer <harald@redhat.com> 145-5
- do not make extra nodes in parallel
- restorecon on /dev
2009-08-24 13:03:47 +00:00
Harald Hoyer
e87fdf7d46 - --enable-debug
- add patch for timestamps in debugging output
2009-08-04 09:16:53 +00:00
Harald Hoyer
f90281fa86 - add patch from upstream git to fix bug #514086
- add version to usbutils build requirement
2009-07-29 12:07:18 +00:00
Harald Hoyer
11f08c47bd - fix file permissions
- remove rpath
- chkconfig --add for udev-post
- fix summaries
- add "Required-Stop" to udev-post
2009-07-24 08:17:35 +00:00
Harald Hoyer
c6a10bffc7 - version 145
- add "udevlog" kernel command line option to redirect the output of udevd
    to /dev/.udev/udev.log
2009-07-14 12:09:01 +00:00
Harald Hoyer
b13ebc6c30 - version 145
- add "udevlog" kernel command line option to redirect the output of udevd
    to /dev/.udev/udev.log
2009-07-14 10:32:55 +00:00
Harald Hoyer
6a426a6072 - add acpi floppy modalias
- add retrigger of failed events in udev-post.init
- killall pids of udev in %pre
2009-07-03 13:48:12 +00:00
Harald Hoyer
5b53a68b94 add libtool to BuildRequires 2009-06-22 10:47:52 +00:00
Harald Hoyer
ab3b433362 add libacl-devel to BuildRequires 2009-06-22 10:27:37 +00:00
Harald Hoyer
367c089c3e add gperf to BuildRequires 2009-06-22 10:04:58 +00:00
Harald Hoyer
b4fc064139 - version 143 2009-06-22 09:59:16 +00:00
Harald Hoyer
6e123c68b9 obsolete libgudev 2009-06-19 14:41:31 +00:00
Harald Hoyer
d2639a068d - version 143 2009-06-19 14:36:59 +00:00
Harald Hoyer
d6ea95d064 - git fix: udevadm: settle - fix timeout
- git fix: OWNER/GROUP: fix if logic
- git fix: rule-generator: cd - skip by-path links if we create by-id links
- git fix: fix possible endless loop for GOTO to non-existent LABEL
- git fix: cdrom_id: suppress ID_CDROM_MEDIA_STATE=blank for plain
    non-writable CDROM media
2009-06-08 09:10:26 +00:00
Harald Hoyer
c0058968a2 - delay device-mapper changes 2009-06-08 08:56:38 +00:00
518b087e2a - Rebuild in dist-f12 2009-06-05 15:08:49 +00:00
Harald Hoyer
825b6c9802 - version 142
- no more libvolume_id and vol_id
2009-05-15 14:41:18 +00:00
Harald Hoyer
c47b803b68 - fixed post and pre 2009-04-16 06:49:39 +00:00
Harald Hoyer
fdc9d097a5 - fix for CVE-2009-1186 (bug #495052)
- Resolves: rhbz#495052
2009-04-15 17:42:26 +00:00
Harald Hoyer
e07ce5575e - version 141 2009-04-14 13:47:31 +00:00
Harald Hoyer
ffe7cacec8 - double the IMPORT buffer (bug #488554)
- Resolves: rhbz#488554
2009-04-01 13:40:26 +00:00
Harald Hoyer
2a1f66d75f - renamed modprobe /etc/modprobe.d/floppy-pnp to
/etc/modprobe.d/floppy-pnp.conf (bug #492732 #488768)
- Resolves: rhbz#492732
2009-04-01 13:29:30 +00:00
Harald Hoyer
9f98e34d40 - speedup of start_udev by doing make_extra_nodes in parallel to the daemon
start
2009-03-03 13:11:08 +00:00
Harald Hoyer
ab646bebe4 - version 139 2009-02-27 07:49:44 +00:00
Jesse Keating
0b109e9f9e - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-25 22:30:47 +00:00
Harald Hoyer
75cb6aeb76 fixed typo 2009-02-05 07:52:35 +00:00
Harald Hoyer
b0b79fa1f4 - fixed md change/remove event handling 2009-02-05 07:49:49 +00:00
Harald Hoyer
fe7fc4b385 - added 5 second sleep for "modprobedebug" to catch bad modules 2009-02-05 07:35:24 +00:00
Harald Hoyer
021d639f1a - moved groupadd to pre section (bug #483089) 2009-01-30 09:26:48 +00:00
Harald Hoyer
4db620ffcd - version 137
- add vol_id patches from kzak
- dialout group has gid 18 now
2009-01-29 11:49:39 +00:00
Harald Hoyer
e4cfa15239 - added some rule fixes, which will be in udev-137 2009-01-20 12:17:14 +00:00
Harald Hoyer
80a542a733 - test for restorecon in start_udev before it is used (bug #480608)
- added groups video audio cdrom tape dialout in post (might be moved to
    MAKEDEV)
- version 136
2009-01-20 11:58:53 +00:00
Harald Hoyer
975b6aaa58 test for restorecon before using it 2009-01-20 11:16:28 +00:00
Harald Hoyer
b5dbf93f17 - added sepol patch 2008-12-16 16:04:52 +00:00
Harald Hoyer
6e30c7cb59 - changed udevsettle -> udevadm settle
- added doc to libudev-devel
- added more attr and defattr
- various rpmlint fixes
2008-12-16 09:42:56 +00:00
Harald Hoyer
00844ad871 /sbin/udevsettle -> /sbin/udevadm settle 2008-12-16 09:31:55 +00:00
Harald Hoyer
05f6581408 - version 135 2008-12-02 10:23:48 +00:00
Harald Hoyer
5b6b2232ee - version 135 2008-12-02 10:22:49 +00:00
Harald Hoyer
5a26722c4c - version 133 2008-11-19 10:35:08 +00:00
Harald Hoyer
6bccb7062a - version 132
- added memory stick rules (bug #470096)
2008-11-10 10:45:26 +00:00
Harald Hoyer
d301daacbd fixed patch fuzz 2008-10-16 12:25:25 +00:00
Harald Hoyer
6bbb3cd9b1 - added 2 patches for md raid vol_id 2008-10-16 12:13:41 +00:00
Harald Hoyer
3eb03420e3 - version 127 2008-09-02 13:29:10 +00:00
Harald Hoyer
4ba917fed6 corrected fuzz 2008-08-08 13:36:37 +00:00
Harald Hoyer
bfbe3859db readded accidently removed udev-118-sysconf.patch 2008-08-08 13:29:32 +00:00
Harald Hoyer
7177394ffd - version 126
- fixed udevadm syntax in start_udev (credits B.J.W. Polman)
- removed some manually created devices from makedev (bug #457125)
2008-08-08 13:12:38 +00:00
Harald Hoyer
9625547be1 - readded udevcontrol, udevtrigger symlinks for Fedora 9, which are needed
by live-cd-tools
2008-06-20 09:48:41 +00:00
Harald Hoyer
15769f5bb4 - version 124
- removed udevcontrol, udevtrigger symlinks (use udevadm now)
2008-06-12 09:37:40 +00:00
Jeremy Katz
b4f99d61c8 - Add lost F9 change to remove /dev/.udev in start_udev (#442827) 2008-06-03 16:56:25 +00:00
Harald Hoyer
87b3260317 - version 121 + latest git fixes 2008-05-16 10:11:19 +00:00
Harald Hoyer
161545341e - added patches from git:
- persistent device naming: also read unpartitioned media
- scsi_id: initialize serial strings
- logging: add trailing newline to all strings
- path_id: remove subsystem whitelist
- allow setting of MODE="0000"
- selinux: more context settings
- rules_generator: net rules - always add KERNEL== match to generated rules
- cdrom_id: replace with version which also exports media properties
- vol_id: add --offset option
- udevinfo: do not replace chars when printing ATTR== matches
2008-04-23 15:45:38 +00:00
Harald Hoyer
c5a0ade124 - fixed pre/preun scriptlets (bug #441941)
- removed fedora specific patch for selinux symlink handling
2008-04-11 14:21:50 +00:00
Harald Hoyer
062c6309a9 - removed warning about deprecated /lib/udev/devices (rhbz#440961)
- replaced /usr/bin/find with shell find function (rhbz#440961)
2008-04-05 16:29:16 +00:00
Harald Hoyer
b9c56fc59b - version 120 2008-04-04 13:35:38 +00:00
Harald Hoyer
61a823a384 - removed /var/lib/udev/rules.d again 2008-03-17 18:09:38 +00:00
Harald Hoyer
d2a67004f3 - turned off MAKEDEV cache, until the generated shell scripts create new
directories
2008-03-14 22:37:47 +00:00
Harald Hoyer
16b250a44c - added more support for the "modprobedebug" kernel command line option, to
debug hanging kernel modules
2008-03-13 16:45:35 +00:00
Harald Hoyer
8a8111a52f - added /etc/sysconfig/udev to configure some speedups
- added "udevnopersist" as a kernel command line, to disable persistent
    storage symlink generation
2008-03-13 15:28:17 +00:00
Harald Hoyer
31d0512f74 - files from /var/lib/udev/rules.d are copied to /dev/.udev/rules.d at
startup and back at shutdown
- persistent cd and net rules generate the files in /dev/.udev/rules.d now
- added post section to symlink 70-persistent-cd.rules
    70-persistent-net.rules from /etc/udev/rules.d to /dev/.udev/rules.d
2008-03-13 14:33:00 +00:00
Harald Hoyer
2a36d8e695 - moved all generated files to /var/lib/udev (also 70-persistent-cd.rules
70-persistent-net.rules)
- added a caching mechanism for MAKEDEV (saves some seconds on startup)
- added trigger for selinux-policy and MAKEDEV to remove the udev cache
    files
2008-03-13 13:00:10 +00:00
Harald Hoyer
c84cd4cf3d - disabled static version (no static selinux lib) 2008-02-20 17:33:26 +00:00
Harald Hoyer
79dad1f706 - made symlinks relative (rhbz#432878)
- removed the backgrounding of node creation (rhbz#381461)
- do not change sg group ownership to disk for scanners (rhbz#432602)
- attempt to fix selinux symlink bug (rhbz#345071)
- fixed URL
- made rpmlint mostly happy
2008-02-20 17:05:41 +00:00
Harald Hoyer
1c37832687 - do not change sg group ownership to disk for scanners (rhbz#432602) 2008-02-20 11:36:39 +00:00
Harald Hoyer
8f604df8fa satisfied rpmlint 2008-02-20 11:26:02 +00:00
Harald Hoyer
117812f91a - removed the backgrounding of node creation (rhbz#381461) 2008-02-20 11:07:27 +00:00
Jesse Keating
909e9abf9b - Autorebuild for GCC 4.3 2008-02-19 04:41:57 +00:00
Harald Hoyer
fcbc73b894 - reenabled static version 2008-01-09 12:23:31 +00:00
Harald Hoyer
044f8613a1 - reenabled static version 2008-01-09 12:22:57 +00:00
Harald Hoyer
fccce2dfec -disabled static version 2008-01-08 14:04:12 +00:00
Harald Hoyer
e7cf708e92 - version 118
- removed old USB compat rule (rhbz#424331)
2008-01-08 13:29:53 +00:00
Harald Hoyer
61e50e95cd - fixed preun chkconfig
- added /sbin path to chkconfig in post section
- patch: do not generate net rules for type > 256
- fixes glitches appearing in bz#323991
2007-10-18 19:50:31 +00:00
Dennis Gilmore
092d541b37 sparc64 requires -fPIE not -fpie 2007-10-16 15:52:09 +00:00
Bill Nottingham
3d3a3af458 makefile update to properly grab makefile.common 2007-10-15 19:29:11 +00:00
Harald Hoyer
2c757bb7e3 - version 116 2007-10-15 13:20:44 +00:00
Harald Hoyer
014d60c40e - added upstream patch for rhbz#328691
- moved floppy module loading to pnp-alias in /etc/modprobe.d/floppy-pnp
2007-10-12 11:53:35 +00:00
Harald Hoyer
96e7b59eba - better modprobe options for the kernel command line 'modprobedebug'
option
2007-10-10 13:08:00 +00:00
Harald Hoyer
64b78c2124 removed duplicate patch 2007-09-21 16:34:52 +00:00
Harald Hoyer
b4a3ffd582 - more upstream fixes from git 2007-09-21 16:32:15 +00:00
Harald Hoyer
ee9c1f7f35 - some upstream fixes from git
- removed last_rule for loop rules
- added "udevinfo udevtrace" kernel command line options for better
    debugging
2007-09-20 12:27:11 +00:00
Harald Hoyer
5d7b98eb8a - some upstream fixes from git
- last_rule for loop rules (speedup for live-cds/qemu with 128 loop
    devices)
2007-09-07 12:52:05 +00:00
Harald Hoyer
3cc65b7cd1 - version 115 2007-08-24 09:42:49 +00:00
Harald Hoyer
0789c11c2a - version 115 2007-08-24 08:37:19 +00:00
Harald Hoyer
c4ef96efd1 - added patch to prevent persistent net rules for virtual network
interfaces, like vmware and vlans
2007-08-23 09:11:21 +00:00
Harald Hoyer
658661bad2 - changed license tag
- changed to latest upstream rule ordering
2007-08-23 08:24:52 +00:00
Harald Hoyer
6710a9140a - changed license tag
- changed to latest upstream rule ordering
2007-08-23 08:24:09 +00:00
Harald Hoyer
97c8b1ad1f - fixed isapnp rule (bug #251815)
- fix for nikon cameras (bug #251401)
2007-08-13 08:39:12 +00:00
Harald Hoyer
dd250c2ac7 version 114 2007-08-10 14:43:14 +00:00
Harald Hoyer
6b943c46bb preview of rules unification 2007-08-10 14:38:10 +00:00
Harald Hoyer
59eb68e649 - version 114
- big rule unification and cleanup
- added persistent names for network and cdrom devices over reboot
2007-08-10 14:37:15 +00:00
Harald Hoyer
dff4f6c762 - removed "noreplace" config tag from rules (#250043) 2007-07-30 16:24:32 +00:00
Harald Hoyer
6df79e09b9 - major rule cleanup
- removed persistent rules from 50 and included upstream rules
- removed skip_wait from modprobe
2007-07-27 16:51:38 +00:00
Harald Hoyer
756aedf68e - kernel does not provide usb_device anymore, corrected the rules (#248916) 2007-07-20 12:58:24 +00:00
Harald Hoyer
bf94b5f5d6 - kernel changed subsystem name from usb_device to usb_endpoint, corrected
the rule (#248916)
2007-07-19 16:46:06 +00:00
Harald Hoyer
000e6f0367 - do not collect modprobes (bug #222542), because firmware loading seems to
depend on it.
2007-07-14 10:12:48 +00:00
Harald Hoyer
c0da6ce073 some speedups 2007-07-09 15:46:45 +00:00
Harald Hoyer
e84f72ec14 fw_unit_symlinks.sh added 2007-07-03 10:24:16 +00:00
Harald Hoyer
d866c81409 - added more firewire symlinks (#240770)
- minor rule patches
2007-07-03 10:18:00 +00:00
Harald Hoyer
9a1b893d92 - added rule for SD cards in a TI FlashMedia slot (#217070) 2007-06-27 08:32:59 +00:00
Harald Hoyer
e45ef51da4 version 113 2007-06-26 14:39:44 +00:00
Harald Hoyer
419422bec2 - do not skip all events on modprobe (#238385)
- Resolves: rhbz#238385
2007-05-02 10:18:23 +00:00
Harald Hoyer
99bbbf0c28 - modprobe only on modalias (bug #238140)
- make startup messages visible again
- speedup boot process by not executing pam_console_apply while booting
- Resolves: rhbz#238140
2007-04-27 13:47:00 +00:00
Harald Hoyer
80bb3482f9 removed debugging actions 2007-04-27 12:55:55 +00:00
Harald Hoyer
0f63ee4555 moved modprobe rules 2007-04-27 12:55:14 +00:00
Harald Hoyer
4b43db589b fixed console output 2007-04-27 12:48:07 +00:00
Harald Hoyer
fe89c88d6c - added env patch
- moved modprobe to the beginning
- added some speedups
2007-04-27 12:47:41 +00:00
Harald Hoyer
52ea19d569 - create floppy device nodes with the correct selinux context (bug #235953)
- Resolves: rhbz#235953
2007-04-11 09:53:30 +00:00
Harald Hoyer
a10f11986e - version 106
- specfile cleanup
- removed pilot rule
- removed dasd_id and dasd_id rule
- provide static versions in a subpackage
2007-03-07 18:01:25 +00:00
Harald Hoyer
43a10928d3 version 105 2007-02-21 13:19:32 +00:00
Harald Hoyer
be27b3c4c3 - moved uinput to input subdirectory (rhbz#213854)
- added USB floppy symlinks (rhbz#185171)
- fixed ZIP drive handling (rhbz#223016)
- Resolves: rhbz#213854,rhbz#185171,rhbz#223016
2007-02-06 12:59:51 +00:00
Harald Hoyer
cd5b874b87 merged in RHEL changes 2007-01-23 14:54:57 +00:00
Harald Hoyer
743bae2ad5 - version 104
- merged changes from RHEL
2007-01-23 14:53:25 +00:00
Harald Hoyer
84691f7da4 - changed DRIVER to DRIVERS
- Resolves: rhbz#218160
2006-12-06 12:13:57 +00:00
Harald Hoyer
7af1642351 - changed SYSFS to new ATTR rules
- Resolves: rhbz#214898
2006-11-10 10:06:15 +00:00
Harald Hoyer
9b390c6367 - changed SYSFS to new ATTR rules
- Resolves: rhbz#214898
2006-11-10 09:58:51 +00:00
Harald Hoyer
076b875099 version 103 2006-11-07 14:25:07 +00:00
Harald Hoyer
9aa3450a5b - skip persistent block for gnbd devices (bug #210227) 2006-10-11 06:49:42 +00:00
Harald Hoyer
fe7568c899 - fixed path_id script (bug #207139) 2006-10-04 08:24:32 +00:00
Jeremy Katz
3edf874f7b - autoload mmc_block (#171687) 2006-10-03 20:18:25 +00:00
Harald Hoyer
0664b17c28 removed modprobe uglieness... better done by /etc/modprobe.d 2006-09-28 14:10:54 +00:00
Harald Hoyer
51abef88ed - load the mptctl module, if mptbase is loaded (bug #205510) 2006-09-28 13:58:57 +00:00
Harald Hoyer
b4febc7639 - typo in xpram/slram rule (bug #205563) 2006-09-27 16:18:08 +00:00
Harald Hoyer
e708ad0b18 *** empty log message *** 2006-09-25 15:08:44 +00:00
Harald Hoyer
44e34d2079 - improved error msg for firmware_helper (bug #206944)
- added xpram symlink to slram device nodes (bug #135733)
- removed infiniband rules (bug #206224)
- use newest path_id script (bug #207139)
2006-09-25 15:02:11 +00:00
Harald Hoyer
1bfaa201d6 fixed bug #204157 2006-08-29 08:09:03 +00:00
Harald Hoyer
aadbc380b9 - added udevtimeout=<timeout in seconds> kernel command line parameters for
start_udev (default is to wait forever)
2006-08-16 15:27:55 +00:00
Harald Hoyer
51a22f5380 - new speedup patch for selinux (bug #202673) 2006-08-16 12:10:56 +00:00
Harald Hoyer
7742e8f29d allow long comments 2006-08-10 12:13:36 +00:00
Harald Hoyer
a4391af2e9 allow long comments 2006-08-10 12:08:54 +00:00
Harald Hoyer
6e058278a3 allow long comments 2006-08-10 12:08:39 +00:00
Harald Hoyer
1aaca4fdb7 - fixed CAPI device nodes (bug #139321)
- fixed bug #201422
2006-08-07 12:59:00 +00:00
Harald Hoyer
fdb25436cf - more infiniband rules (bug #198501) 2006-07-12 09:27:01 +00:00
Harald Hoyer
2d859988b1 - more infiniband rules (bug #198501) 2006-07-12 09:26:05 +00:00
Jesse Keating
17ce3a409f bumped for rebuild 2006-07-12 08:35:18 +00:00
Harald Hoyer
1cf039df54 *** empty log message *** 2006-07-06 07:18:04 +00:00
Harald Hoyer
8678664c78 - added option to debug udev with kernel cmdline option "udevdebug" 2006-07-06 07:17:43 +00:00
Harald Hoyer
e308c60caf version 095 2006-07-05 11:50:38 +00:00
Harald Hoyer
e07d68eda3 version 094 2006-06-14 10:21:55 +00:00
Peter Jones
2d22e1c5c1 - fix typo in pam-console rule 2006-05-21 21:06:55 +00:00
Harald Hoyer
8407649468 -version 092 2006-05-18 15:38:32 +00:00
Harald Hoyer
b494cb39bf corrected some rules 2006-05-09 10:06:13 +00:00
Harald Hoyer
63e9a00026 patched for lib64 2006-05-03 16:19:56 +00:00
Harald Hoyer
6fd25ff85d - added subpackages libvolume_id and libvolume_id-devel 2006-05-03 15:54:21 +00:00
Harald Hoyer
f738113d4a version 091 2006-05-03 11:20:16 +00:00
Harald Hoyer
fdab2e6f19 version 090 2006-04-19 11:48:15 +00:00
Harald Hoyer
e3cabf4370 correction for shlib 2006-04-13 12:37:35 +00:00
Harald Hoyer
f8783dfa92 correction for shlib 2006-04-13 10:36:46 +00:00
Harald Hoyer
1b56481816 correction for shlib 2006-04-13 09:58:06 +00:00
Harald Hoyer
f486785e65 correction for shlib 2006-04-13 09:48:33 +00:00
Harald Hoyer
7206c443f2 - version 089
- do not force loading of parport_pc (bug #186850)
- manually load snd-powermac (bug #176761)
- added usb floppy symlink (bug #185171)
- start_udev uses udevtrigger now instead of udevstart
2006-04-13 08:46:43 +00:00
Harald Hoyer
48e0255fe1 fixed pam_console rule 2006-03-08 10:14:43 +00:00
Harald Hoyer
9a32ee02ac fixed DRI permissions 2006-03-06 15:35:13 +00:00
Bill Nottingham
0904310594 need ENV{MODALIAS} as well 2006-03-05 05:59:32 +00:00
Bill Nottingham
a826011309 type much? 2006-03-05 05:43:08 +00:00
Bill Nottingham
ebe26124be $modalias is deprecated in favor of $env{MODALIAS}. And it appears to break
with things that only have MODALIAS in the environment, as opposed to
    sysfs files. Such as, say, firewire. (#181494)
2006-03-05 05:42:06 +00:00
Harald Hoyer
4f5a6fab69 fixed cdrom rule 2006-03-02 07:33:00 +00:00
Harald Hoyer
2df070cad8 *docs*
- Enumeration for cdrom, floppy, scanner, changer is gone (no more
    /dev/cdrom1). udev now creates one device (cdrom, floppy, scanner,
    changer) for compatibility (random device wins) and e.g. for cdrom:
    e.g. /dev/cdrom -> hdd /dev/cdrom-hdc -> hdc /dev/cdrom-hdd -> hdd
2006-03-01 17:09:15 +00:00
Harald Hoyer
9becaa37c6 - fixed ZIP drive thrashing (bz #181041 #182601)
- fixed enumeration (%e does not work anymore) (bz #183288)
2006-03-01 16:31:25 +00:00
Peter Jones
60b94c9c31 - input from notting WRT pidof arguments 2006-02-24 23:40:51 +00:00
Peter Jones
3892caa221 - don't start udev in %post unless it's already running
- turn udev off in %preun before chkconfig --del
- changelog + release
2006-02-24 23:23:09 +00:00
Harald Hoyer
9aaef42608 - put back original WAIT_FOR_SYSFS rule 2006-02-24 16:14:11 +00:00
Harald Hoyer
88af617e09 - removed WAIT_FOR_SYSFS rule 2006-02-24 14:55:34 +00:00
Harald Hoyer
897627043a - fixed group issue with vol_id (bz #181432)
- fixed dvb permissions (bz #179993)
- added support for scsi media changer (bz #181911)
- fixed pktcdvd device creation (bz #161268)
2006-02-22 08:19:05 +00:00
Florian La Roche
9654039373 - -3 2006-02-21 19:47:51 +00:00
Florian La Roche
f65c3cb4a8 - auch, seems -2 is already commited from Jeremy??? 2006-02-21 19:47:21 +00:00
Florian La Roche
ee52139bd5 - also output space at end of startup message 2006-02-21 19:35:08 +00:00
Jesse Keating
ae856446bf bump for bug in double-long on ppc(64) 2006-02-11 05:54:36 +00:00
Jeremy Katz
43f97d0c53 okay, don't need this 2006-02-07 21:45:33 +00:00
Jeremy Katz
5c6d821ff8 - continue to include /sbin/udev for now as it's needed for determining the
version of udev
2006-02-07 21:23:49 +00:00
Harald Hoyer
e6df39c973 version 084 2006-02-07 11:13:42 +00:00
Harald Hoyer
96d1914827 version 084 2006-02-07 11:06:20 +00:00
Harald Hoyer
745b7ce640 closed fd leak 2006-02-06 15:30:27 +00:00
Harald Hoyer
869e091c24 - changed usb device naming 2006-01-26 08:12:17 +00:00
Harald Hoyer
2fd405182f - put WAIT_FOR_SYSFS rules in 05-udev-early.rules 2006-01-24 12:37:12 +00:00
Harald Hoyer
05e9aae4f8 *** empty log message *** 2006-01-23 10:39:02 +00:00
Harald Hoyer
d6fb468686 - added some WAIT_FOR_SYSFS rules
- removed warning message, if udev_db is not available
2006-01-23 10:38:21 +00:00
Kristian Høgsberg
986dcaeed0 - Drop udev dependency (#178621). 2006-01-22 18:47:58 +00:00
Harald Hoyer
bdceeec2ea - removed group "video" from the rules
- fixed specfile
- load nvram, floppy, parport and lp modules in
    /etc/sysconfig/modules/udev-stw.modules until there is a better
    solution
- fixed more floppy module loading
2006-01-11 12:11:24 +00:00
Harald Hoyer
069e790657 *** empty log message *** 2005-12-23 12:48:26 +00:00
Harald Hoyer
a6a2d82126 *** empty log message *** 2005-12-23 12:42:02 +00:00
Harald Hoyer
25b1a2f2cc - fixed floppy module loading
- added monitor socket
- fixed typo in dvb rule
2005-12-23 12:41:33 +00:00
Bill Nottingham
4963a5abc6 greylist usb/firewire controllers in udevstart 2005-12-21 22:43:32 +00:00
Harald Hoyer
b2c48e51e1 version 078 2005-12-21 11:36:19 +00:00
Harald Hoyer
ba918a836b *** empty log message *** 2005-12-15 11:47:26 +00:00
Harald Hoyer
5b946d5c23 - switched back to udevstart and use active /dev/.udev/queue waiting in
start_udev
- removed support for old kernels
- refined some udev.rules
2005-12-15 11:46:52 +00:00
Harald Hoyer
7af6ec89ac version 077 2005-12-13 15:38:10 +00:00
Harald Hoyer
54b5db6c13 - version 077
- patch to include udevstart2 in udevd and delay daemonize until queue is
    empty
2005-12-13 15:36:46 +00:00
Jesse Keating
b3e7af9c85 gcc update bump 2005-12-09 22:43:40 +00:00
Harald Hoyer
6c25f29a81 - speedup udevd with selinux by calling matchpathcon_init_prefix()
- version 076
2005-12-06 17:48:12 +00:00
Harald Hoyer
26b9ad252b version 076 2005-11-29 13:25:51 +00:00
Harald Hoyer
6878729651 speedup udev event replay with udevstart2 2005-11-21 12:04:44 +00:00
Harald Hoyer
62bf5c0de0 refined start_udev for old kernels 2005-11-21 07:25:27 +00:00
Harald Hoyer
b2213416f9 *** empty log message *** 2005-11-15 11:22:23 +00:00
Harald Hoyer
ccbb0e0820 *** empty log message *** 2005-11-15 11:16:11 +00:00
Harald Hoyer
5cc58e0e20 - moved /etc/udev/scripts to /lib/udev
- moved /etc/udev/devices to /lib/udev/devices
- added new event replay for kernel >= 2.6.15
- added usb devices
- renamed cpu device to cpuid (bug #161538)
- changed vendor string "Onstream" to "On[sS]tream" (bug #173043)
- compiled all *_id programs statically
2005-11-14 17:42:04 +00:00
Harald Hoyer
805b385273 - version 075 2005-11-11 13:26:37 +00:00
Harald Hoyer
24f280441e - version 075 2005-11-11 13:06:41 +00:00
Harald Hoyer
2a6c1dbd3f udev-071 2005-10-25 11:24:16 +00:00
Harald Hoyer
902abf37cf udev-071 2005-10-25 11:21:26 +00:00
Harald Hoyer
285fc6caaa removed group usb 2005-10-10 09:44:52 +00:00
Harald Hoyer
8593922a5a added libsepol-devel BuildReq, refined persistent rules 2005-10-10 08:03:06 +00:00
Harald Hoyer
5f9b8f914d added -lsepol 2005-10-10 06:41:55 +00:00
Harald Hoyer
50e08bddca corrected c&p edd_id rule, symlink for js devices 2005-10-07 14:40:52 +00:00
Harald Hoyer
8f9b6c9f1c added edd_id 2005-10-06 07:19:33 +00:00
Harald Hoyer
0131431c96 special handling of IEEE1394 firewire devices (bug #168093) 2005-09-30 12:23:22 +00:00
Harald Hoyer
f3564757ad added missing path_id 2005-09-23 10:46:26 +00:00
Harald Hoyer
5174c128fa readded volume_id now known as vol_id, bug #168883 2005-09-21 07:32:10 +00:00
Bill Nottingham
81638c327d fix firmware loading 2005-09-15 12:34:55 +00:00
Bill Nottingham
1d3eed8331 bad day. fix build 2005-09-14 13:39:04 +00:00
Bill Nottingham
b48a865144 duh 2005-09-14 13:35:08 +00:00
Bill Nottingham
7c0527fe2f bump releases 2005-09-14 13:31:59 +00:00
Bill Nottingham
97e8ede572 own /lib/firmware (#167016) 2005-09-14 13:31:07 +00:00
Harald Hoyer
10981960a3 version 069 2005-09-14 11:53:03 +00:00
Harald Hoyer
1e16a1d5b3 - version 069
- updated rules file
2005-09-14 11:51:46 +00:00
Harald Hoyer
6413004747 compile with pie 2005-08-04 15:12:14 +00:00
Harald Hoyer
fcfdcc0dd5 compile with pie 2005-08-04 15:11:43 +00:00
Harald Hoyer
dc2e00c475 fixed typo bz #138509 2005-08-04 09:01:10 +00:00
Harald Hoyer
f66253e152 *** empty log message *** 2005-08-03 09:37:29 +00:00
Bill Nottingham
b39909ba2e allow pcmcia function id matching (#164665) 2005-08-03 03:01:38 +00:00
Harald Hoyer
5de74438c5 fixed scsi replay 2005-08-02 16:46:33 +00:00
Harald Hoyer
09b238109b changed mode to 0660 for tape devices 2005-08-02 15:23:38 +00:00
Harald Hoyer
5dd903e941 changed SYMLINK= to SYMLINK+= 2005-07-28 11:44:53 +00:00
Bill Nottingham
1b5feedb36 From the udev relnotes: udev 059 ========
...
o udevd listens to netlink events now. The first valid netlink event will
    make udevd ignore any message from udevsend that contains a SEQNUM, to
    avoid duplicate events.
Ergo, don't set it for replay events (#163729).
2005-07-25 03:05:27 +00:00
Bill Nottingham
5dd3b5697e update to 063 2005-07-20 00:59:21 +00:00
Bill Nottingham
d7fbf6a26f obsolete firmware.agent too 2005-07-19 23:59:03 +00:00
Bill Nottingham
c6b772ba10 ship release-notes in %%doc 2005-07-14 04:05:11 +00:00
Bill Nottingham
e8b633ad2c - update to 062
- use included ata_id, build usb_id
- load modules for pci, usb, pcmcia
2005-07-13 14:33:08 +00:00
Harald Hoyer
b198546ab3 compile with pie 2005-07-07 13:36:42 +00:00
Bill Nottingham
76f89a4401 update to 058 to fix sysfs incompatibility 2005-05-21 03:38:00 +00:00
Harald Hoyer
70ffb4bd24 move ata_identify to udev-persistent 2005-05-12 12:39:51 +00:00
Harald Hoyer
9e968b14fa polished persistent 2005-05-12 10:19:24 +00:00
Bill Nottingham
2619d5983e add changelog 2005-05-06 01:37:56 +00:00
Bill Nottingham
ee5ba570de remove excludearch 2005-05-06 01:37:16 +00:00
Bill Nottingham
490aa9a9d0 beta blocker, need to get this built 2005-05-05 16:25:34 +00:00
Bill Nottingham
e588d498e2 better check for mounted /dev (#156862) 2005-05-05 16:24:26 +00:00
Peter Jones
288828e9c4 fix udevstart.static build 2005-04-27 04:49:20 +00:00
Harald Hoyer
9cc61248a2 - added Inifiniband devices (bug #147035)
- fixed pam_console.dev (bug #153250)
2005-04-21 13:11:33 +00:00
Harald Hoyer
58d8ac4f79 version 057 2005-04-18 10:42:19 +00:00
Daniel J Walsh
cec444ea88 - Fix SELinux during creation of Symlinks 2005-04-15 20:33:13 +00:00
Daniel J Walsh
a914be6a14 - Fix SELinux during creation of Symlinks 2005-04-15 20:33:00 +00:00
Harald Hoyer
39700cfdea updated source 2005-04-15 15:09:49 +00:00
Harald Hoyer
ea1258e60f update to udev-056 2005-04-11 13:03:51 +00:00
Warren Togami
38007829b4 own default and net dirs (#151368 Hans de Goede) 2005-03-29 09:23:22 +00:00
Warren Togami
880828fba2 bump spec 2005-03-08 09:24:12 +00:00
Harald Hoyer
049b932f67 *** empty log message *** 2005-03-02 16:21:16 +00:00
Harald Hoyer
3519453b7c - fixed rh#144598 2005-03-02 16:19:37 +00:00
Harald Hoyer
19db7d9495 - introducing /etc/udev/makedev.d/50-udev.nodes
- glibcstatic patch modified to let gcc4 compile udev
2005-02-18 13:07:41 +00:00
Harald Hoyer
a1468479a3 doh, reverted the start_udev devel version, which slipped in 2005-02-14 10:27:27 +00:00
Harald Hoyer
73cab9fba7 doh, reverted the start_udev devel version, which slipped in 2005-02-14 10:25:48 +00:00
Harald Hoyer
07dd434632 corrected typo in udev.rules 2005-02-10 11:10:57 +00:00
Harald Hoyer
9f1515e388 new version 050 2005-01-11 10:53:53 +00:00
Harald Hoyer
25d4c8997b /dev/cpu/0/microcode -> /dev/cpu/microcode 2005-01-11 10:41:46 +00:00
Daniel J Walsh
bd451ac0cb - Call selinux_restore to fix labeling problem in selinux
- Fixes rh#142817
2004-12-21 22:00:40 +00:00
Harald Hoyer
8d2eeee09b -maybe fixed bug rh#143367 2004-12-21 15:35:37 +00:00
Harald Hoyer
e2e104fd8f - remove with -fr in case of a directory (bug rh#142962) 2004-12-16 14:49:09 +00:00
Harald Hoyer
7c6763afcb - fixed a case where reading /proc/ide/hd?/media returns EIO
- changed all device node permissions of group "disk" to 0640
2004-12-16 14:36:32 +00:00
Harald Hoyer
c4e0a92835 - version 048 2004-12-13 13:02:40 +00:00
Harald Hoyer
03795f0742 - version 048
- major specfile cleanup
2004-12-13 13:00:54 +00:00
Harald Hoyer
14ac6ac432 version 042 2004-11-04 16:16:37 +00:00
49 changed files with 1 additions and 6856 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
udev-145.tar.bz2

View file

@ -1,38 +0,0 @@
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

View file

@ -1,117 +0,0 @@
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

View file

@ -1,72 +0,0 @@
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

View file

@ -1,49 +0,0 @@
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

View file

@ -1,38 +0,0 @@
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

View file

@ -1,26 +0,0 @@
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

View file

@ -1,58 +0,0 @@
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

View file

@ -1,24 +0,0 @@
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

View file

@ -1,53 +0,0 @@
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

View file

@ -1,55 +0,0 @@
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

View file

@ -1,18 +0,0 @@
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"

View file

@ -1,131 +0,0 @@
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

View file

@ -1,82 +0,0 @@
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

View file

@ -1,88 +0,0 @@
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

View file

@ -1,277 +0,0 @@
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

View file

@ -1,121 +0,0 @@
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

View file

@ -1,25 +0,0 @@
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

View file

@ -1,25 +0,0 @@
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

View file

@ -1,79 +0,0 @@
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

View file

@ -1,38 +0,0 @@
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

View file

@ -1,36 +0,0 @@
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

View file

@ -1,183 +0,0 @@
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

View file

@ -1,26 +0,0 @@
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

View file

@ -1,6 +0,0 @@
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

View file

@ -1,295 +0,0 @@
--- 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 {

1
dead.package Normal file
View file

@ -0,0 +1 @@
obsolete udev, it is replaced by systemd

View file

@ -1,25 +0,0 @@
#!/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

View file

@ -1,624 +0,0 @@
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;
}

View file

@ -1 +0,0 @@
ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/

View file

@ -1 +0,0 @@
b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2

View file

@ -1,334 +0,0 @@
#!/bin/bash
#
# start_udev
#
# script to initialize /dev by using udev.
#
# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
#
# Released under the GPL v2 only.
#
# This needs to be run at the earliest possible point in the boot
# process.
#
# Based on the udev init.d script
#
# Thanks go out to the Gentoo developers for proving
# that this is possible to do.
#
# Yes, it's very verbose, feel free to turn off all of the echo calls,
# they were there to make me feel better that everything was working
# properly during development...
#
# don't use udev if sysfs is not mounted.
sysfs_dir=/sys
export TZ=/etc/localtime
[ -d $sysfs_dir/class ] || exit 1
[ -r /proc/mounts ] || 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
ln -snf /proc/self/fd/1 $udev_root/stdout
ln -snf /proc/self/fd/2 $udev_root/stderr
ln -snf /proc/kcore $udev_root/core
[ -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;
USE_MD5="false"
[ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true"
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
done
fi
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
}
kill_udevd() {
if [ -x /sbin/pidof ]; then
pid=`/sbin/pidof -x udevd`
[ -n "$pid" ] && kill $pid
fi
}
findalias () {
local n
for n in "$1"/* ; do
[ -h "$n" ] && continue
[ -d "$n" ] && { findalias "$n" ; continue; }
[ "${n##*/}" == "modalias" ] && echo $(cat $n)
done
}
# 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 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
prog=udev
ret=0
STRING=$"Starting $prog: "
# propagate $udev_root from /sys
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 + $?]
}
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

View file

@ -1,8 +0,0 @@
--- 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'"

View file

@ -1,298 +0,0 @@
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);

View file

@ -1,14 +0,0 @@
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

View file

@ -1,638 +0,0 @@
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

File diff suppressed because it is too large Load diff

View file

@ -1,18 +0,0 @@
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"

View file

@ -1,20 +0,0 @@
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",

View file

@ -1,14 +0,0 @@
--- 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"

View file

@ -1,34 +0,0 @@
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"

View file

@ -1,96 +0,0 @@
#!/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

View file

@ -1,55 +0,0 @@
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);

View file

@ -1,34 +0,0 @@
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"

View file

@ -1,29 +0,0 @@
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"

1567
udev.spec

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
# 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"

View file

@ -1 +0,0 @@
udev-145.tar.bz2

View file

@ -1,54 +0,0 @@
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-----