Compare commits

...
Sign in to create a new pull request.

280 commits

Author SHA1 Message Date
Harald Hoyer
e6e25c4fd5 fixed keymap patch 2010-09-21 15:57:31 +02:00
Harald Hoyer
eeb28fb171 - backported the upstream cdrom_id bugfixes and enhancements
(bug #533643)
- backported the upstream keymaps bugfixes and enhancements
  (bug #444440)
- fixed floppy devices (bug#492404)
2010-09-21 13:43:32 +02:00
Fedora Release Engineering
61152969f1 dist-git conversion 2010-07-29 14:37:56 +00:00
Harald Hoyer
ba4a0c0ced - more cdrom_id bugfixes which can prevent autoclose of some cdroms 2010-04-27 11:48:03 +00:00
Harald Hoyer
1968477995 - more cdrom_id bugfixes for buggy cdroms and CD burning (bug #577659,
bug#566535, bug#561003, bug#481346, bug#580812)
2010-04-13 16:27:29 +00:00
Harald Hoyer
c03ca5cb95 - only correct the timestamp, if UTC=="no" 2010-03-22 14:26:49 +00:00
Harald Hoyer
c7c784416a - touch with "--no-create", will not use open() and trigger devs/watchdogs
(bug #575417)
2010-03-22 13:36:31 +00:00
Harald Hoyer
ec584eb00a - fixed return code of touching the device nodes [FAIL] -> [OK] 2010-03-22 10:09:32 +00:00
Harald Hoyer
1b5f4efe18 - let cdrom_id use O_EXCL (#566535)
- fix interface rename bug (#531074 #544357)
- remove GPL COPYING file from LGPL subpackages (#536843)
- create /dev/hugepages subdir in start_udev (#541998)
- fix brightness keys on MSI Wind U-100 (#563453)
- fix dangling symlinks (#566680)
- remove erroneous 19d2:2000 modeswitch rule (#569296)
- add firewire video devices (#559581)
- touch all device nodes after udev settled for the timezone timestamp
    (#569335)
- removed one modem-modeswitch line (#574949)
- add virtio symlinks
2010-03-19 10:51:37 +00:00
Harald Hoyer
403d10d45b - removed one modem-modeswitch line (#541686)
- added one modem-modeswitch line (#547759)
- fixed dangling symlinks (#558235)
- fixed initscript (#557771, #523976,
- obsolete DeviceKit (#532961)
- fixed copyright (#536843)
2010-01-26 11:37:27 +00:00
Bill Nottingham
d5e28cedbd Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:13:35 +00:00
14f60d8eee - Fix blu-ray and hd-dvd drives not getting detected properly when a medium
is absent
- Fix upgrade from Fedora 11 with bluez installed (#533925)
2009-11-11 13:11:19 +00:00
78de653bd9 - Fix blu-ray and hd-dvd drives not getting detected properly when a medium
is absent
- Fix upgrade from Fedora 11 with bluez installed (#533925)
2009-11-11 13:10:12 +00:00
Harald Hoyer
a25fcafdac - obsolete DeviceKit and DeviceKit-devel (#532961)
- add NEWS file to the doc section
- automatically turn on hotplugged CPUs (#523127)
- fixed udev-post exit codes (#523976)
- own directory /lib/udev/keymaps (#521801)
- no more floppy modaliases (#514329)
- added two more modems to modem-modeswitch.rules (#515349)
2009-11-05 13:09:07 +00:00
f8770c42af - Update hid2hci from udev master, fixes problems with Dell Bluetooth
dongles not working (#532628)
2009-11-05 00:19:42 +00:00
Harald Hoyer
f066808f9f This patch got lost in the devel -> F12 F13 -> devel transition phase
- add ConsoleKit patch for ConsoleKit 0.4.1
2009-10-13 10:43:22 +00:00
Harald Hoyer
98e286f417 add bugzilla number to changelog 2009-10-13 10:37:13 +00:00
Harald Hoyer
350f832b8b - recognize a devtmpfs on /dev 2009-10-13 10:35:52 +00:00
Jesse Keating
9544e4100e Initialize branch F-12 for udev 2009-09-29 07:10:25 +00:00
Harald Hoyer
84034b7edc - 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
38bb0a1d1c - obsolete libgudev and libgudev-devel (bug #523569) 2009-09-23 17:27:00 +00:00
844c25b2ef - drop ifnarch s390x for usbutils, as we now have usbutils for s390x 2009-08-24 15:19:15 +00:00
Harald Hoyer
ed8467d2d0 - 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
ff1bbcac61 - --enable-debug
- add patch for timestamps in debugging output
2009-08-04 09:16:53 +00:00
Harald Hoyer
563c14d0dd - 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
e32392db41 - 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
b1ca17ab06 - 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
fd89784a95 - 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
12ae6f794f - 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
d833d3f1d5 add libtool to BuildRequires 2009-06-22 10:47:52 +00:00
Harald Hoyer
f788b2db50 add libacl-devel to BuildRequires 2009-06-22 10:27:37 +00:00
Harald Hoyer
bd74de9f37 add gperf to BuildRequires 2009-06-22 10:04:58 +00:00
Harald Hoyer
6d20cb6d08 - version 143 2009-06-22 09:59:16 +00:00
Harald Hoyer
fa01ff8e9d obsolete libgudev 2009-06-19 14:41:31 +00:00
Harald Hoyer
644b709215 - version 143 2009-06-19 14:36:59 +00:00
Harald Hoyer
38424c3316 - 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
c7f7d69498 - delay device-mapper changes 2009-06-08 08:56:38 +00:00
11d20dd280 - Rebuild in dist-f12 2009-06-05 15:08:49 +00:00
Harald Hoyer
4b8c514c5e - version 142
- no more libvolume_id and vol_id
2009-05-15 14:41:18 +00:00
Harald Hoyer
98f3cc06dc - fixed post and pre 2009-04-16 06:49:39 +00:00
Harald Hoyer
7867726261 - fix for CVE-2009-1186 (bug #495052)
- Resolves: rhbz#495052
2009-04-15 17:42:26 +00:00
Harald Hoyer
0345074c5f - version 141 2009-04-14 13:47:31 +00:00
Harald Hoyer
0d974e5004 - double the IMPORT buffer (bug #488554)
- Resolves: rhbz#488554
2009-04-01 13:40:26 +00:00
Harald Hoyer
a8a4eac9ed - 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
508e6c586f - 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
aa693300db - version 139 2009-02-27 07:49:44 +00:00
Jesse Keating
e7834dea17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild 2009-02-25 22:30:47 +00:00
Harald Hoyer
08f8626fe5 fixed typo 2009-02-05 07:52:35 +00:00
Harald Hoyer
6f3c896370 - fixed md change/remove event handling 2009-02-05 07:49:49 +00:00
Harald Hoyer
18ab8dfd4e - added 5 second sleep for "modprobedebug" to catch bad modules 2009-02-05 07:35:24 +00:00
Harald Hoyer
67d1ec9319 - moved groupadd to pre section (bug #483089) 2009-01-30 09:26:48 +00:00
Harald Hoyer
16c3d8a2e9 - version 137
- add vol_id patches from kzak
- dialout group has gid 18 now
2009-01-29 11:49:39 +00:00
Harald Hoyer
b88dfa1ae4 - added some rule fixes, which will be in udev-137 2009-01-20 12:17:14 +00:00
Harald Hoyer
a97f8f1ef5 - 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
1e8bee8017 test for restorecon before using it 2009-01-20 11:16:28 +00:00
Harald Hoyer
186679e9be - added sepol patch 2008-12-16 16:04:52 +00:00
Harald Hoyer
0305ca6ecf - 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
54b85c77f5 /sbin/udevsettle -> /sbin/udevadm settle 2008-12-16 09:31:55 +00:00
Harald Hoyer
7128d2cebc - version 135 2008-12-02 10:23:48 +00:00
Harald Hoyer
70982ca944 - version 135 2008-12-02 10:22:49 +00:00
Harald Hoyer
aad9b436ba - version 133 2008-11-19 10:35:08 +00:00
Harald Hoyer
a2c4251423 - version 132
- added memory stick rules (bug #470096)
2008-11-10 10:45:26 +00:00
Harald Hoyer
c54320c2aa fixed patch fuzz 2008-10-16 12:25:25 +00:00
Harald Hoyer
e162135c18 - added 2 patches for md raid vol_id 2008-10-16 12:13:41 +00:00
Harald Hoyer
514c411277 - version 127 2008-09-02 13:29:10 +00:00
Harald Hoyer
10373cfe68 corrected fuzz 2008-08-08 13:36:37 +00:00
Harald Hoyer
01f6ec751b readded accidently removed udev-118-sysconf.patch 2008-08-08 13:29:32 +00:00
Harald Hoyer
acceb8edac - 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
96f20ade11 - readded udevcontrol, udevtrigger symlinks for Fedora 9, which are needed
by live-cd-tools
2008-06-20 09:48:41 +00:00
Harald Hoyer
b7eb78ef70 - version 124
- removed udevcontrol, udevtrigger symlinks (use udevadm now)
2008-06-12 09:37:40 +00:00
Jeremy Katz
78ca30d6e7 - Add lost F9 change to remove /dev/.udev in start_udev (#442827) 2008-06-03 16:56:25 +00:00
Harald Hoyer
bf2483e47a - version 121 + latest git fixes 2008-05-16 10:11:19 +00:00
Harald Hoyer
8bc2a79fab - 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
238456bb10 - fixed pre/preun scriptlets (bug #441941)
- removed fedora specific patch for selinux symlink handling
2008-04-11 14:21:50 +00:00
Harald Hoyer
363e26a66c - 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
14262589b4 - version 120 2008-04-04 13:35:38 +00:00
Harald Hoyer
1fac5b6c17 - removed /var/lib/udev/rules.d again 2008-03-17 18:09:38 +00:00
Harald Hoyer
fafa121247 - turned off MAKEDEV cache, until the generated shell scripts create new
directories
2008-03-14 22:37:47 +00:00
Harald Hoyer
0de73c8761 - 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
cb52ede995 - 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
30648cd5cf - 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
1b14e18140 - 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
0df45d9402 - disabled static version (no static selinux lib) 2008-02-20 17:33:26 +00:00
Harald Hoyer
cbc032e671 - 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
7d4c197cd6 - do not change sg group ownership to disk for scanners (rhbz#432602) 2008-02-20 11:36:39 +00:00
Harald Hoyer
9aadd0eaf5 satisfied rpmlint 2008-02-20 11:26:02 +00:00
Harald Hoyer
77cc6a4be0 - removed the backgrounding of node creation (rhbz#381461) 2008-02-20 11:07:27 +00:00
Jesse Keating
8ceed97a39 - Autorebuild for GCC 4.3 2008-02-19 04:41:57 +00:00
Harald Hoyer
9c261920b2 - reenabled static version 2008-01-09 12:23:31 +00:00
Harald Hoyer
300efe54f4 - reenabled static version 2008-01-09 12:22:57 +00:00
Harald Hoyer
01f9c12dac -disabled static version 2008-01-08 14:04:12 +00:00
Harald Hoyer
98b3b5a9d8 - version 118
- removed old USB compat rule (rhbz#424331)
2008-01-08 13:29:53 +00:00
Harald Hoyer
9cdf66968a - 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
8c436454d5 sparc64 requires -fPIE not -fpie 2007-10-16 15:52:09 +00:00
Bill Nottingham
c5a016502b makefile update to properly grab makefile.common 2007-10-15 19:29:11 +00:00
Harald Hoyer
e238b076d0 - version 116 2007-10-15 13:20:44 +00:00
Harald Hoyer
8fc8ffa952 - 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
71fa48ad54 - better modprobe options for the kernel command line 'modprobedebug'
option
2007-10-10 13:08:00 +00:00
Harald Hoyer
fbebb54fa5 removed duplicate patch 2007-09-21 16:34:52 +00:00
Harald Hoyer
0a45e02b4b - more upstream fixes from git 2007-09-21 16:32:15 +00:00
Harald Hoyer
7276a579d3 - 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
32d4d659a3 - 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
b08eedbbbe - version 115 2007-08-24 09:42:49 +00:00
Harald Hoyer
5954cf5860 - version 115 2007-08-24 08:37:19 +00:00
Harald Hoyer
347b9e7b57 - 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
7f7c2af6bd - changed license tag
- changed to latest upstream rule ordering
2007-08-23 08:24:52 +00:00
Harald Hoyer
d5ad1a068a - changed license tag
- changed to latest upstream rule ordering
2007-08-23 08:24:09 +00:00
Harald Hoyer
16c9d87686 - fixed isapnp rule (bug #251815)
- fix for nikon cameras (bug #251401)
2007-08-13 08:39:12 +00:00
Harald Hoyer
238417da34 version 114 2007-08-10 14:43:14 +00:00
Harald Hoyer
381aac3306 preview of rules unification 2007-08-10 14:38:10 +00:00
Harald Hoyer
86664196dc - 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
288053072e - removed "noreplace" config tag from rules (#250043) 2007-07-30 16:24:32 +00:00
Harald Hoyer
0c7e43fa82 - 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
a89500695c - kernel does not provide usb_device anymore, corrected the rules (#248916) 2007-07-20 12:58:24 +00:00
Harald Hoyer
3df6869de7 - kernel changed subsystem name from usb_device to usb_endpoint, corrected
the rule (#248916)
2007-07-19 16:46:06 +00:00
Harald Hoyer
b2eb238642 - do not collect modprobes (bug #222542), because firmware loading seems to
depend on it.
2007-07-14 10:12:48 +00:00
Harald Hoyer
838d6f0abc some speedups 2007-07-09 15:46:45 +00:00
Harald Hoyer
d225aa6f07 fw_unit_symlinks.sh added 2007-07-03 10:24:16 +00:00
Harald Hoyer
850b10c011 - added more firewire symlinks (#240770)
- minor rule patches
2007-07-03 10:18:00 +00:00
Harald Hoyer
0baca8cc28 - added rule for SD cards in a TI FlashMedia slot (#217070) 2007-06-27 08:32:59 +00:00
Harald Hoyer
e3118d12c9 version 113 2007-06-26 14:39:44 +00:00
Harald Hoyer
c02d5e7aa3 - do not skip all events on modprobe (#238385)
- Resolves: rhbz#238385
2007-05-02 10:18:23 +00:00
Harald Hoyer
a3cd1a4969 - 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
4934a31591 removed debugging actions 2007-04-27 12:55:55 +00:00
Harald Hoyer
0c424bbfe6 moved modprobe rules 2007-04-27 12:55:14 +00:00
Harald Hoyer
75c73d28b7 fixed console output 2007-04-27 12:48:07 +00:00
Harald Hoyer
06da6a6069 - added env patch
- moved modprobe to the beginning
- added some speedups
2007-04-27 12:47:41 +00:00
Harald Hoyer
2740f62afe - create floppy device nodes with the correct selinux context (bug #235953)
- Resolves: rhbz#235953
2007-04-11 09:53:30 +00:00
Harald Hoyer
5df8d65998 - 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
2e382f6b1e version 105 2007-02-21 13:19:32 +00:00
Harald Hoyer
fadf33e335 - 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
618e6f6261 merged in RHEL changes 2007-01-23 14:54:57 +00:00
Harald Hoyer
98705b9413 - version 104
- merged changes from RHEL
2007-01-23 14:53:25 +00:00
Harald Hoyer
fb8d91fe42 - changed DRIVER to DRIVERS
- Resolves: rhbz#218160
2006-12-06 12:13:57 +00:00
Harald Hoyer
9636bd1e2f - changed SYSFS to new ATTR rules
- Resolves: rhbz#214898
2006-11-10 10:06:15 +00:00
Harald Hoyer
70dd8819a2 - changed SYSFS to new ATTR rules
- Resolves: rhbz#214898
2006-11-10 09:58:51 +00:00
Harald Hoyer
084706393f version 103 2006-11-07 14:25:07 +00:00
Harald Hoyer
f067c6a9e5 - skip persistent block for gnbd devices (bug #210227) 2006-10-11 06:49:42 +00:00
Harald Hoyer
6771560622 - fixed path_id script (bug #207139) 2006-10-04 08:24:32 +00:00
Jeremy Katz
608a9a87ba - autoload mmc_block (#171687) 2006-10-03 20:18:25 +00:00
Harald Hoyer
b9bcdcb26a removed modprobe uglieness... better done by /etc/modprobe.d 2006-09-28 14:10:54 +00:00
Harald Hoyer
313008525e - load the mptctl module, if mptbase is loaded (bug #205510) 2006-09-28 13:58:57 +00:00
Harald Hoyer
6e07a04b5d - typo in xpram/slram rule (bug #205563) 2006-09-27 16:18:08 +00:00
Harald Hoyer
74f03f6eef *** empty log message *** 2006-09-25 15:08:44 +00:00
Harald Hoyer
5a0a7e049e - 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
6835307e21 fixed bug #204157 2006-08-29 08:09:03 +00:00
Harald Hoyer
43c8550b6c - 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
7e61e26873 - new speedup patch for selinux (bug #202673) 2006-08-16 12:10:56 +00:00
Harald Hoyer
5bc3b73e6d allow long comments 2006-08-10 12:13:36 +00:00
Harald Hoyer
d8976451b0 allow long comments 2006-08-10 12:08:54 +00:00
Harald Hoyer
31f40a010f allow long comments 2006-08-10 12:08:39 +00:00
Harald Hoyer
5f733958d4 - fixed CAPI device nodes (bug #139321)
- fixed bug #201422
2006-08-07 12:59:00 +00:00
Harald Hoyer
a8b7c5571f - more infiniband rules (bug #198501) 2006-07-12 09:27:01 +00:00
Harald Hoyer
a4724b996b - more infiniband rules (bug #198501) 2006-07-12 09:26:05 +00:00
Jesse Keating
aabb5be520 bumped for rebuild 2006-07-12 08:35:18 +00:00
Harald Hoyer
a6ba76f7ea *** empty log message *** 2006-07-06 07:18:04 +00:00
Harald Hoyer
2819f21324 - added option to debug udev with kernel cmdline option "udevdebug" 2006-07-06 07:17:43 +00:00
Harald Hoyer
e0c5f362b6 version 095 2006-07-05 11:50:38 +00:00
Harald Hoyer
7a83ca4938 version 094 2006-06-14 10:21:55 +00:00
Peter Jones
508c20a9a1 - fix typo in pam-console rule 2006-05-21 21:06:55 +00:00
Harald Hoyer
5f0c226881 -version 092 2006-05-18 15:38:32 +00:00
Harald Hoyer
e204ad31a5 corrected some rules 2006-05-09 10:06:13 +00:00
Harald Hoyer
3ecb8f9522 patched for lib64 2006-05-03 16:19:56 +00:00
Harald Hoyer
67c4ed9f4c - added subpackages libvolume_id and libvolume_id-devel 2006-05-03 15:54:21 +00:00
Harald Hoyer
39ba214178 version 091 2006-05-03 11:20:16 +00:00
Harald Hoyer
cccc0b3e45 version 090 2006-04-19 11:48:15 +00:00
Harald Hoyer
d7d38eba96 correction for shlib 2006-04-13 12:37:35 +00:00
Harald Hoyer
6026b801d4 correction for shlib 2006-04-13 10:36:46 +00:00
Harald Hoyer
e33d945d10 correction for shlib 2006-04-13 09:58:06 +00:00
Harald Hoyer
4326637d6c correction for shlib 2006-04-13 09:48:33 +00:00
Harald Hoyer
91c5ea6ed8 - 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
100cc6a6c9 fixed pam_console rule 2006-03-08 10:14:43 +00:00
Harald Hoyer
764b5c7e23 fixed DRI permissions 2006-03-06 15:35:13 +00:00
Bill Nottingham
208737699c need ENV{MODALIAS} as well 2006-03-05 05:59:32 +00:00
Bill Nottingham
dde4b309c0 type much? 2006-03-05 05:43:08 +00:00
Bill Nottingham
92075f0849 $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
a0ba0ae9a3 fixed cdrom rule 2006-03-02 07:33:00 +00:00
Harald Hoyer
c3c5561cb2 *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
c1a67e70a4 - 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
a4aecd4b45 - input from notting WRT pidof arguments 2006-02-24 23:40:51 +00:00
Peter Jones
82dd215147 - 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
5013d06017 - put back original WAIT_FOR_SYSFS rule 2006-02-24 16:14:11 +00:00
Harald Hoyer
8f5d2af8dc - removed WAIT_FOR_SYSFS rule 2006-02-24 14:55:34 +00:00
Harald Hoyer
205e54f2c1 - 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
77b1c4d775 - -3 2006-02-21 19:47:51 +00:00
Florian La Roche
35d832f558 - auch, seems -2 is already commited from Jeremy??? 2006-02-21 19:47:21 +00:00
Florian La Roche
76aea984e9 - also output space at end of startup message 2006-02-21 19:35:08 +00:00
Jesse Keating
81b3909c85 bump for bug in double-long on ppc(64) 2006-02-11 05:54:36 +00:00
Jeremy Katz
f70d2d2b2d okay, don't need this 2006-02-07 21:45:33 +00:00
Jeremy Katz
faa7f43302 - 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
42ddda11e3 version 084 2006-02-07 11:13:42 +00:00
Harald Hoyer
5a533bf047 version 084 2006-02-07 11:06:20 +00:00
Harald Hoyer
01f7ae296a closed fd leak 2006-02-06 15:30:27 +00:00
Harald Hoyer
e7c55fe821 - changed usb device naming 2006-01-26 08:12:17 +00:00
Harald Hoyer
6caf5e0273 - put WAIT_FOR_SYSFS rules in 05-udev-early.rules 2006-01-24 12:37:12 +00:00
Harald Hoyer
91b0730d35 *** empty log message *** 2006-01-23 10:39:02 +00:00
Harald Hoyer
8a99a76aa0 - 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
30e9fb1b99 - Drop udev dependency (#178621). 2006-01-22 18:47:58 +00:00
Harald Hoyer
ad3a3fa524 - 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
8732912db7 *** empty log message *** 2005-12-23 12:48:26 +00:00
Harald Hoyer
cae4d5634d *** empty log message *** 2005-12-23 12:42:02 +00:00
Harald Hoyer
ec15aa3500 - fixed floppy module loading
- added monitor socket
- fixed typo in dvb rule
2005-12-23 12:41:33 +00:00
Bill Nottingham
edb32338e6 greylist usb/firewire controllers in udevstart 2005-12-21 22:43:32 +00:00
Harald Hoyer
ac0575b898 version 078 2005-12-21 11:36:19 +00:00
Harald Hoyer
9f3db1c82d *** empty log message *** 2005-12-15 11:47:26 +00:00
Harald Hoyer
b088d50d80 - 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
f0328a5793 version 077 2005-12-13 15:38:10 +00:00
Harald Hoyer
cda5da2373 - 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
a6e26500c4 gcc update bump 2005-12-09 22:43:40 +00:00
Harald Hoyer
d6ea1ff887 - speedup udevd with selinux by calling matchpathcon_init_prefix()
- version 076
2005-12-06 17:48:12 +00:00
Harald Hoyer
c0524fbf07 version 076 2005-11-29 13:25:51 +00:00
Harald Hoyer
7e8bfdbdb2 speedup udev event replay with udevstart2 2005-11-21 12:04:44 +00:00
Harald Hoyer
3a22ece851 refined start_udev for old kernels 2005-11-21 07:25:27 +00:00
Harald Hoyer
9facb8e38d *** empty log message *** 2005-11-15 11:22:23 +00:00
Harald Hoyer
180677a830 *** empty log message *** 2005-11-15 11:16:11 +00:00
Harald Hoyer
dece018eeb - 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
292d9e03b5 - version 075 2005-11-11 13:26:37 +00:00
Harald Hoyer
79d25109ad - version 075 2005-11-11 13:06:41 +00:00
Harald Hoyer
4e926cc718 udev-071 2005-10-25 11:24:16 +00:00
Harald Hoyer
7ec47ce06c udev-071 2005-10-25 11:21:26 +00:00
Harald Hoyer
150d933f5d removed group usb 2005-10-10 09:44:52 +00:00
Harald Hoyer
42ba1f491b added libsepol-devel BuildReq, refined persistent rules 2005-10-10 08:03:06 +00:00
Harald Hoyer
0cdda30aff added -lsepol 2005-10-10 06:41:55 +00:00
Harald Hoyer
f429dee409 corrected c&p edd_id rule, symlink for js devices 2005-10-07 14:40:52 +00:00
Harald Hoyer
cca555da48 added edd_id 2005-10-06 07:19:33 +00:00
Harald Hoyer
01ec7ffda3 special handling of IEEE1394 firewire devices (bug #168093) 2005-09-30 12:23:22 +00:00
Harald Hoyer
24ef4a4392 added missing path_id 2005-09-23 10:46:26 +00:00
Harald Hoyer
1bfc08fe69 readded volume_id now known as vol_id, bug #168883 2005-09-21 07:32:10 +00:00
Bill Nottingham
1afddeb410 fix firmware loading 2005-09-15 12:34:55 +00:00
Bill Nottingham
b7f78b31ed bad day. fix build 2005-09-14 13:39:04 +00:00
Bill Nottingham
5fd2c373c6 duh 2005-09-14 13:35:08 +00:00
Bill Nottingham
8bc213fad4 bump releases 2005-09-14 13:31:59 +00:00
Bill Nottingham
0420d6c43a own /lib/firmware (#167016) 2005-09-14 13:31:07 +00:00
Harald Hoyer
d3bb620481 version 069 2005-09-14 11:53:03 +00:00
Harald Hoyer
208f1b3c29 - version 069
- updated rules file
2005-09-14 11:51:46 +00:00
Harald Hoyer
f76388842c compile with pie 2005-08-04 15:12:14 +00:00
Harald Hoyer
f94df72a6b compile with pie 2005-08-04 15:11:43 +00:00
Harald Hoyer
08abd96bc6 fixed typo bz #138509 2005-08-04 09:01:10 +00:00
Harald Hoyer
b674ce74fa *** empty log message *** 2005-08-03 09:37:29 +00:00
Bill Nottingham
21237992ed allow pcmcia function id matching (#164665) 2005-08-03 03:01:38 +00:00
Harald Hoyer
ffe870ce74 fixed scsi replay 2005-08-02 16:46:33 +00:00
Harald Hoyer
40a19a21df changed mode to 0660 for tape devices 2005-08-02 15:23:38 +00:00
Harald Hoyer
a73cdc0aeb changed SYMLINK= to SYMLINK+= 2005-07-28 11:44:53 +00:00
Bill Nottingham
6ad46f3bf3 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
a0d2b27043 update to 063 2005-07-20 00:59:21 +00:00
Bill Nottingham
14b5ed6ffb obsolete firmware.agent too 2005-07-19 23:59:03 +00:00
Bill Nottingham
6e5cd3a635 ship release-notes in %%doc 2005-07-14 04:05:11 +00:00
Bill Nottingham
733e59faf9 - 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
5ce806de29 compile with pie 2005-07-07 13:36:42 +00:00
Bill Nottingham
2c74069c8f update to 058 to fix sysfs incompatibility 2005-05-21 03:38:00 +00:00
Harald Hoyer
d66c9f1462 move ata_identify to udev-persistent 2005-05-12 12:39:51 +00:00
Harald Hoyer
52a5eda3d7 polished persistent 2005-05-12 10:19:24 +00:00
Bill Nottingham
207d787937 add changelog 2005-05-06 01:37:56 +00:00
Bill Nottingham
fd06507230 remove excludearch 2005-05-06 01:37:16 +00:00
Bill Nottingham
a55305a8ad beta blocker, need to get this built 2005-05-05 16:25:34 +00:00
Bill Nottingham
416d2957fb better check for mounted /dev (#156862) 2005-05-05 16:24:26 +00:00
Peter Jones
69e033e496 fix udevstart.static build 2005-04-27 04:49:20 +00:00
Harald Hoyer
a96ef60d54 - added Inifiniband devices (bug #147035)
- fixed pam_console.dev (bug #153250)
2005-04-21 13:11:33 +00:00
Harald Hoyer
64442a64d9 version 057 2005-04-18 10:42:19 +00:00
Daniel J Walsh
327f83d0d1 - Fix SELinux during creation of Symlinks 2005-04-15 20:33:13 +00:00
Daniel J Walsh
4692a3ff96 - Fix SELinux during creation of Symlinks 2005-04-15 20:33:00 +00:00
Harald Hoyer
555529ed2a updated source 2005-04-15 15:09:49 +00:00
Harald Hoyer
df1892cd11 update to udev-056 2005-04-11 13:03:51 +00:00
Warren Togami
31a721f2cc own default and net dirs (#151368 Hans de Goede) 2005-03-29 09:23:22 +00:00
Warren Togami
60f8a02e24 bump spec 2005-03-08 09:24:12 +00:00
Harald Hoyer
cd5a71c39f *** empty log message *** 2005-03-02 16:21:16 +00:00
Harald Hoyer
4bd4bcf89d - fixed rh#144598 2005-03-02 16:19:37 +00:00
Harald Hoyer
5a7d228655 - 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
a5c19a95ea doh, reverted the start_udev devel version, which slipped in 2005-02-14 10:27:27 +00:00
Harald Hoyer
132296ce1c doh, reverted the start_udev devel version, which slipped in 2005-02-14 10:25:48 +00:00
Harald Hoyer
a86cd2527c corrected typo in udev.rules 2005-02-10 11:10:57 +00:00
Harald Hoyer
365c82c995 new version 050 2005-01-11 10:53:53 +00:00
Harald Hoyer
4c18a67274 /dev/cpu/0/microcode -> /dev/cpu/microcode 2005-01-11 10:41:46 +00:00
Daniel J Walsh
a48e079ae6 - Call selinux_restore to fix labeling problem in selinux
- Fixes rh#142817
2004-12-21 22:00:40 +00:00
Harald Hoyer
ca08dd8bf1 -maybe fixed bug rh#143367 2004-12-21 15:35:37 +00:00
Harald Hoyer
b84222682c - remove with -fr in case of a directory (bug rh#142962) 2004-12-16 14:49:09 +00:00
Harald Hoyer
ef3022c468 - 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
3fcf0b0030 - version 048 2004-12-13 13:02:40 +00:00
Harald Hoyer
616a8ffbbb - version 048
- major specfile cleanup
2004-12-13 13:00:54 +00:00
Harald Hoyer
76b7bdc383 version 042 2004-11-04 16:16:37 +00:00
50 changed files with 6389 additions and 473 deletions

View file

@ -1,8 +0,0 @@
udev-032.tar.bz2
pam_console_setowner-1.3.tgz
pam_console_setowner-1.4.tgz
udev-034.tar.bz2
udev-035.tar.bz2
udev-036.tar.bz2
udev-038.tar.gz
udev-039.tar.gz

1
.gitignore vendored Normal file
View file

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

View file

@ -0,0 +1,38 @@
From 7505831b7ee7b04d84424d2ed306a76abd32871c Mon Sep 17 00:00:00 2001
From: David Zeuthen <davidz@redhat.com>
Date: Tue, 10 Nov 2009 12:32:38 -0500
Subject: [PATCH] cdrom_id: Still check profiles even if there is no media
Even when there is no medium in the drive, we should still check the
profiles supported by the drive. Otherwise we fail to detect things
like Blu-ray drives. See
https://bugzilla.gnome.org/show_bug.cgi?id=600273
for more information.
Signed-off-by: David Zeuthen <davidz@redhat.com>
---
extras/cdrom_id/cdrom_id.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 6ea763b..2380b15 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -583,9 +583,9 @@ int main(int argc, char *argv[])
goto exit;
}
- /* check for media */
- if (cd_media_compat(udev, fd) < 0)
- goto print;
+ /* check for media - don't bail if there's no media as we still need to
+ * to read profiles */
+ cd_media_compat(udev, fd);
/* check if drive talks MMC */
if (cd_inquiry(udev, fd) < 0)
--
1.6.5.2

View file

@ -0,0 +1,117 @@
From 1dc0ee343df6b6e2ce0591ff08a0aeae2aa2196f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 27 Jul 2009 23:24:27 +0200
Subject: [PATCH 1/5] enumeration: move ALSA control devices to the end of the enumerated devices of each card
Generally ALSA control devices should be the last ones to be processed
for ACL changes and similar operations because they can then be used as
indicators that ACL management finished for all device nodes of a
specific card.
This patch simple moves each controlC device behind all the pcmC devices
(and similar).
---
libudev/libudev-enumerate.c | 59 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 56 insertions(+), 3 deletions(-)
diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c
index db8c514..e372079 100644
--- a/libudev/libudev-enumerate.c
+++ b/libudev/libudev-enumerate.c
@@ -187,7 +187,8 @@ static int syspath_cmp(const void *p1, const void *p2)
return ret;
}
-static int devices_delay(struct udev *udev, const char *syspath)
+/* For devices that should be moved to the absolute end of the list */
+static int devices_delay_end(struct udev *udev, const char *syspath)
{
static const char *delay_device_list[] = {
"/block/md",
@@ -207,6 +208,32 @@ static int devices_delay(struct udev *udev, const char *syspath)
return 0;
}
+/* For devices that should just be moved a little bit later, just
+ * before the point where some common path prefix changes. Returns the
+ * number of characters that make up that common prefix */
+static size_t devices_delay_later(struct udev *udev, const char *syspath)
+{
+ const char *c;
+
+ /* For sound cards the control device must be enumerated last
+ * to make sure it's the final device node that gets ACLs
+ * applied. Applications rely on this fact and use ACL changes
+ * on the control node as an indicator that the ACL change of
+ * the entire sound card completed. The kernel makes this
+ * guarantee when creating those devices, and hence we should
+ * too when enumerating them. */
+
+ if ((c = strstr(syspath, "/sound/card"))) {
+ c += 11;
+ c += strcspn(c, "/");
+
+ if (strncmp(c, "/controlC", 9) == 0)
+ return c - syspath + 1;
+ }
+
+ return 0;
+}
+
/**
* udev_enumerate_get_list_entry:
* @udev_enumerate: context
@@ -220,7 +247,8 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude
if (!udev_enumerate->devices_uptodate) {
unsigned int i;
unsigned int max;
- struct syspath *prev = NULL;
+ struct syspath *prev = NULL, *move_later = NULL;
+ size_t move_later_prefix;
udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list);
qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
@@ -237,14 +265,39 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude
prev = entry;
/* skip to be delayed devices, and add them to the end of the list */
- if (devices_delay(udev_enumerate->udev, entry->syspath)) {
+ if (devices_delay_end(udev_enumerate->udev, entry->syspath)) {
syspath_add(udev_enumerate, entry->syspath);
continue;
}
+ /* skip to be delayed devices, and move the to
+ * the point where the prefix changes. We can
+ * only move one item at a time. */
+ if (!move_later) {
+ move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath);
+
+ if (move_later_prefix > 0) {
+ move_later = entry;
+ continue;
+ }
+ }
+
+ if (move_later &&
+ strncmp(entry->syspath, move_later->syspath, move_later_prefix) != 0) {
+
+ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
+ move_later->syspath, NULL, 0, 0);
+ move_later = NULL;
+ }
+
udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
entry->syspath, NULL, 0, 0);
}
+
+ if (move_later)
+ udev_list_entry_add(udev_enumerate->udev, &udev_enumerate->devices_list,
+ move_later->syspath, NULL, 0, 0);
+
/* add and cleanup delayed devices from end of list */
for (i = max; i < udev_enumerate->devices_cur; i++) {
struct syspath *entry = &udev_enumerate->devices[i];
--
1.6.4.4

View file

@ -0,0 +1,72 @@
From 4db7e84ad817944c624256b310d44bd888121c8e Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Fri, 17 Jul 2009 13:24:37 +0200
Subject: [PATCH 2/5] udevd: add timestamp to --debug output
---
libudev/libudev-util-private.c | 3 ++-
udev/udevd.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c
index 5f5f4c1..f7daa94 100644
--- a/libudev/libudev-util-private.c
+++ b/libudev/libudev-util-private.c
@@ -249,6 +249,8 @@ int util_run_program(struct udev *udev, const char *command, char **envp,
int i;
int err = 0;
+ info(udev, "'%s' started\n", command);
+
/* build argv from command */
util_strscpy(arg, sizeof(arg), command);
i = 0;
@@ -273,7 +275,6 @@ int util_run_program(struct udev *udev, const char *command, char **envp,
argv[0] = arg;
argv[1] = NULL;
}
- info(udev, "'%s'\n", command);
/* prepare pipes from child to parent */
if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
diff --git a/udev/udevd.c b/udev/udevd.c
index 2cdc18b..69d509c 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -31,6 +31,7 @@
#include <time.h>
#include <getopt.h>
#include <dirent.h>
+#include <sys/time.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/signalfd.h>
@@ -53,8 +54,15 @@ static void log_fn(struct udev *udev, int priority,
const char *format, va_list args)
{
if (debug) {
- fprintf(stderr, "[%d] %s: ", (int) getpid(), fn);
- vfprintf(stderr, format, args);
+ char buf[1024];
+ struct timeval tv;
+ struct timezone tz;
+
+ vsnprintf(buf, sizeof(buf), format, args);
+ gettimeofday(&tv, &tz);
+ fprintf(stderr, "%llu.%06u [%u] %s: %s",
+ (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec,
+ (int) getpid(), fn, buf);
} else {
vsyslog(priority, format, args);
}
@@ -266,6 +274,7 @@ static void worker_new(struct event *event)
struct worker_message msg;
int err;
+ info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev));
udev_event = udev_event_new(dev);
if (udev_event == NULL)
_exit(3);
--
1.6.4.4

View file

@ -0,0 +1,49 @@
From 7766066b221302d75002cd5d5a021281388ee56c Mon Sep 17 00:00:00 2001
From: Andrew Church <gentoo4@achurch.org>
Date: Thu, 24 Sep 2009 10:51:12 -0700
Subject: [PATCH 3/5] fix wrong parameter size on ioctl FIONREAD
On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott <zzam@gentoo.org> wrote:
> It is about ioctl failures on amd64:
> http://bugs.gentoo.org/show_bug.cgi?id=286041
>
> A bad parameter type to an ioctl() call causes udev-146 to generate "error
> getting buffer for inotify" messages in syslog. The offending code is
> roughly:
>
> ssize_t nbytes, pos;
> // ...
> ioctl(fd, FIONREAD, &nbytes);
>
> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least
> through gentoo-sources-2.6.31) uses type int:
>
> p = (void __user *) arg;
> switch (cmd) {
> case FIONREAD:
> // ...
> ret = put_user(send_len, (int __user *) p);
>
> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent
> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has
> a LOT of memory).
---
udev/udevd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/udev/udevd.c b/udev/udevd.c
index 69d509c..511cb4b 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -656,7 +656,7 @@ static void handle_ctrl_msg(struct udev_ctrl *uctrl)
/* read inotify messages */
static int handle_inotify(struct udev *udev)
{
- ssize_t nbytes, pos;
+ int nbytes, pos;
char *buf;
struct inotify_event *ev;
--
1.6.4.4

View file

@ -0,0 +1,38 @@
From 36b35c884fc06bc2babf0ec840cb423b94a45f93 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sun, 20 Sep 2009 19:07:51 +0200
Subject: [PATCH 4/5] fix single-session CD detection
ID_CDROM_MEDIA_SESSION_LAST_OFFSET is not set for CDs with only a single
session (i. e. for the vast majority of CDs out there). The previous rules ran
blkid with invalid arguments for these, causing CD detection to fail in
DK-disks and gvfs.
Now check whether we actually have ID_CDROM_MEDIA_SESSION_LAST_OFFSET, and if
not, call blkid without -O for specifying the offset.
Many thanks to Maxim Levitsky for tracking this down!
https://launchpad.net/bugs/431055
---
rules/rules.d/60-persistent-storage.rules | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 64e9578..1b85156 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -61,7 +61,9 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
# probe filesystem metadata of optical drives which have a media inserted
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
--
1.6.4.4

View file

@ -0,0 +1,26 @@
From a09ac6a6ae39512fafe9df331a311113d2a1d9f6 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Sun, 20 Sep 2009 19:21:04 +0200
Subject: [PATCH 5/5] fix previous commit for CD detection
Do not run blkid twice. *brown paperbag*
---
rules/rules.d/60-persistent-storage.rules | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 1b85156..0950847 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -63,7 +63,7 @@ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_
# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
--
1.6.4.4

View file

@ -0,0 +1,58 @@
From 38a3cde11bc77af49a96245b8a8a0f2b583a344c Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 18 Mar 2010 11:14:32 +0100
Subject: [PATCH 35/65] cdrom_id: open non-mounted optical media with O_EXCL
This should prevent confusing drives during CD burning sessions. Based
on a patch from Harald Hoyer.
---
extras/cdrom_id/cdrom_id.c | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 2380b15..e485768 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset;
#define ASC(errcode) (((errcode) >> 8) & 0xFF)
#define ASCQ(errcode) ((errcode) & 0xFF)
+static int is_mounted(const char *device)
+{
+ struct stat statbuf;
+ FILE *fp;
+ int maj, min;
+ int mounted = 0;
+
+ if (stat(device, &statbuf) < 0)
+ return -ENODEV;
+
+ fp = fopen("/proc/self/mountinfo", "r");
+ if (fp == NULL)
+ return -ENOSYS;
+ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
+ printf("got %u %u\n", maj, min);
+ if (makedev(maj, min) == statbuf.st_rdev) {
+ mounted = 1;
+ break;
+ }
+ }
+ fclose(fp);
+ return mounted;
+}
+
static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err)
{
if (err == -1) {
@@ -568,7 +592,7 @@ int main(int argc, char *argv[])
goto exit;
}
- fd = open(node, O_RDONLY | O_NONBLOCK);
+ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
if (fd < 0) {
info(udev, "unable to open '%s'\n", node);
fprintf(stderr, "unable to open '%s'\n", node);
--
1.6.6

View file

@ -0,0 +1,24 @@
From 36a07a8c34a4cff5ad2bbb6e0fdfed49e8191661 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 7 Apr 2010 09:23:46 +0200
Subject: [PATCH 48/65] cdrom_id: remove debugging code
---
extras/cdrom_id/cdrom_id.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index e485768..036ef28 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -126,7 +126,6 @@ static int is_mounted(const char *device)
if (fp == NULL)
return -ENOSYS;
while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
- printf("got %u %u\n", maj, min);
if (makedev(maj, min) == statbuf.st_rdev) {
mounted = 1;
break;
--
1.6.6

View file

@ -0,0 +1,53 @@
From cccfffbe04c01be12fb42cb12f3f7aa5e2a22dd4 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Wed, 7 Apr 2010 09:24:25 +0200
Subject: [PATCH 49/65] cdrom_id: retry to open the device, if EBUSY
We might fight about the device with polling processes, or other
users who probe the device. Retry a few times if the other one goes
away in the meantime.
Based on a patch from Harald Hoyer.
---
extras/cdrom_id/cdrom_id.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 036ef28..7c9f8cc 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
+#include <time.h>
#include <scsi/sg.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -591,7 +592,22 @@ int main(int argc, char *argv[])
goto exit;
}
- fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
+ if (is_mounted(node)) {
+ fd = open(node, O_RDONLY|O_NONBLOCK);
+ } else {
+ int cnt;
+ struct timespec duration;
+
+ srand((unsigned int)getpid());
+ for (cnt = 40; cnt > 0; cnt--) {
+ fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL);
+ if (fd >= 0 || errno != EBUSY)
+ break;
+ duration.tv_sec = 0;
+ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000);
+ nanosleep(&duration, NULL);
+ }
+ }
if (fd < 0) {
info(udev, "unable to open '%s'\n", node);
fprintf(stderr, "unable to open '%s'\n", node);
--
1.6.6

View file

@ -0,0 +1,55 @@
From d45c8c8b01c99180f15e24b22f7cf81eaf3cdd1b Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Wed, 7 Apr 2010 11:32:22 +0200
Subject: [PATCH 50/65] cdrom_id: check mount state in retry loop
Based on a patch from Harald Hoyer.
---
extras/cdrom_id/cdrom_id.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 7c9f8cc..894a890 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -547,6 +547,7 @@ int main(int argc, char *argv[])
const char *node = NULL;
int export = 0;
int fd = -1;
+ int cnt;
int rc = 0;
udev = udev_new();
@@ -592,21 +593,16 @@ int main(int argc, char *argv[])
goto exit;
}
- if (is_mounted(node)) {
- fd = open(node, O_RDONLY|O_NONBLOCK);
- } else {
- int cnt;
+ srand((unsigned int)getpid());
+ for (cnt = 20; cnt > 0; cnt--) {
struct timespec duration;
- srand((unsigned int)getpid());
- for (cnt = 40; cnt > 0; cnt--) {
- fd = open(node, O_RDONLY|O_NONBLOCK|O_EXCL);
- if (fd >= 0 || errno != EBUSY)
- break;
- duration.tv_sec = 0;
- duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000);
- nanosleep(&duration, NULL);
- }
+ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
+ if (fd >= 0 || errno != EBUSY)
+ break;
+ duration.tv_sec = 0;
+ duration.tv_nsec = (100 * 1000 * 1000) + (rand() % 100 * 1000 * 1000);
+ nanosleep(&duration, NULL);
}
if (fd < 0) {
info(udev, "unable to open '%s'\n", node);
--
1.6.6

View file

@ -0,0 +1,18 @@
diff -up udev-145/extras/cdrom_id/60-cdrom_id.rules.git51 udev-145/extras/cdrom_id/60-cdrom_id.rules
--- udev-145/extras/cdrom_id/60-cdrom_id.rules.git51 2009-04-17 00:27:40.000000000 +0200
+++ udev-145/extras/cdrom_id/60-cdrom_id.rules 2010-04-13 18:25:47.000000000 +0200
@@ -1,5 +1,12 @@
# do not edit this file, it will be overwritten on update
# import optical drive properties
-ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \
- KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]|xvd*", IMPORT{program}="cdrom_id --export $tempnode"
+ACTION!="add|change", GOTO="cdrom_end"
+SUBSYSTEM!="block", GOTO="cdrom_end"
+KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
+ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
+
+ENV{ID_CDROM}="1"
+IMPORT{program}="cdrom_id --export $tempnode"
+
+LABEL="cdrom_end"

View file

@ -0,0 +1,131 @@
From 816e6bf0fb0849d03696a4b4ec2334e35e819425 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 13 Apr 2010 10:49:24 +0200
Subject: [PATCH 062/110] cdrom_id: Fix uninitialized variables
In cases where cdrom_id does not go through the entire code path and one of the
probing functions returns -1 or exits early, the remaining variables were never
initialized. This caused effects like "phantom" audio CDs on empty drives, or
bogus data like ID_CDROM_MEDIA_TRACK_COUNT=22528.
Initialize the variables right away to avoid that.
Bug-Ubuntu: https://launchpad.net/bugs/559723
---
extras/cdrom_id/cdrom_id.c | 96 ++++++++++++++++++++++----------------------
1 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 894a890..db3867c 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -56,57 +56,57 @@ static void log_fn(struct udev *udev, int priority,
}
/* device info */
-static unsigned int cd_cd_rom;
-static unsigned int cd_cd_r;
-static unsigned int cd_cd_rw;
-static unsigned int cd_dvd_rom;
-static unsigned int cd_dvd_r;
-static unsigned int cd_dvd_rw;
-static unsigned int cd_dvd_ram;
-static unsigned int cd_dvd_plus_r;
-static unsigned int cd_dvd_plus_rw;
-static unsigned int cd_dvd_plus_r_dl;
-static unsigned int cd_dvd_plus_rw_dl;
-static unsigned int cd_bd;
-static unsigned int cd_bd_r;
-static unsigned int cd_bd_re;
-static unsigned int cd_hddvd;
-static unsigned int cd_hddvd_r;
-static unsigned int cd_hddvd_rw;
-static unsigned int cd_mo;
-static unsigned int cd_mrw;
-static unsigned int cd_mrw_w;
+static unsigned int cd_cd_rom = 0;
+static unsigned int cd_cd_r = 0;
+static unsigned int cd_cd_rw = 0;
+static unsigned int cd_dvd_rom = 0;
+static unsigned int cd_dvd_r = 0;
+static unsigned int cd_dvd_rw = 0;
+static unsigned int cd_dvd_ram = 0;
+static unsigned int cd_dvd_plus_r = 0;
+static unsigned int cd_dvd_plus_rw = 0;
+static unsigned int cd_dvd_plus_r_dl = 0;
+static unsigned int cd_dvd_plus_rw_dl = 0;
+static unsigned int cd_bd = 0;
+static unsigned int cd_bd_r = 0;
+static unsigned int cd_bd_re = 0;
+static unsigned int cd_hddvd = 0;
+static unsigned int cd_hddvd_r = 0;
+static unsigned int cd_hddvd_rw = 0;
+static unsigned int cd_mo = 0;
+static unsigned int cd_mrw = 0;
+static unsigned int cd_mrw_w = 0;
/* media info */
-static unsigned int cd_media;
-static unsigned int cd_media_cd_rom;
-static unsigned int cd_media_cd_r;
-static unsigned int cd_media_cd_rw;
-static unsigned int cd_media_dvd_rom;
-static unsigned int cd_media_dvd_r;
-static unsigned int cd_media_dvd_rw;
-static unsigned int cd_media_dvd_ram;
-static unsigned int cd_media_dvd_plus_r;
-static unsigned int cd_media_dvd_plus_rw;
-static unsigned int cd_media_dvd_plus_r_dl;
-static unsigned int cd_media_dvd_plus_rw_dl;
-static unsigned int cd_media_bd;
-static unsigned int cd_media_bd_r;
-static unsigned int cd_media_bd_re;
-static unsigned int cd_media_hddvd;
-static unsigned int cd_media_hddvd_r;
-static unsigned int cd_media_hddvd_rw;
-static unsigned int cd_media_mo;
-static unsigned int cd_media_mrw;
-static unsigned int cd_media_mrw_w;
-
-static const char *cd_media_state;
-static unsigned int cd_media_session_next;
-static unsigned int cd_media_session_count;
-static unsigned int cd_media_track_count;
-static unsigned int cd_media_track_count_data;
-static unsigned int cd_media_track_count_audio;
-static unsigned long long int cd_media_session_last_offset;
+static unsigned int cd_media = 0;
+static unsigned int cd_media_cd_rom = 0;
+static unsigned int cd_media_cd_r = 0;
+static unsigned int cd_media_cd_rw = 0;
+static unsigned int cd_media_dvd_rom = 0;
+static unsigned int cd_media_dvd_r = 0;
+static unsigned int cd_media_dvd_rw = 0;
+static unsigned int cd_media_dvd_ram = 0;
+static unsigned int cd_media_dvd_plus_r = 0;
+static unsigned int cd_media_dvd_plus_rw = 0;
+static unsigned int cd_media_dvd_plus_r_dl = 0;
+static unsigned int cd_media_dvd_plus_rw_dl = 0;
+static unsigned int cd_media_bd = 0;
+static unsigned int cd_media_bd_r = 0;
+static unsigned int cd_media_bd_re = 0;
+static unsigned int cd_media_hddvd = 0;
+static unsigned int cd_media_hddvd_r = 0;
+static unsigned int cd_media_hddvd_rw = 0;
+static unsigned int cd_media_mo = 0;
+static unsigned int cd_media_mrw = 0;
+static unsigned int cd_media_mrw_w = 0;
+
+static const char *cd_media_state = NULL;
+static unsigned int cd_media_session_next = 0;
+static unsigned int cd_media_session_count = 0;
+static unsigned int cd_media_track_count = 0;
+static unsigned int cd_media_track_count_data = 0;
+static unsigned int cd_media_track_count_audio = 0;
+static unsigned long long int cd_media_session_last_offset = 0;
#define ERRCODE(s) ((((s)[2] & 0x0F) << 16) | ((s)[12] << 8) | ((s)[13]))
#define SK(errcode) (((errcode) >> 16) & 0xF)
--
1.7.0.1

View file

@ -0,0 +1,82 @@
From 2b861dc92757b9a3214c2b8e9d8b1c3f3c162391 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 13 Apr 2010 15:25:48 +0200
Subject: [PATCH 065/110] cdrom_id: Fix uninitialized buffers
Commit 5c6954f is actually a no-op, since static variables are already zero'ed
by default anyway (but we keep it for clarity). The real difference was that a
build with -O0 wor while a build with -O2 didn't.
Turns out that some ioctls do not actually touch the result buffer in some
cases, so we need to zero the result buffers to avoid interpreting random da as
CD properties.
https://launchpad.net/bugs/559723
https://launchpad.net/bugs/561585
---
extras/cdrom_id/cdrom_id.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index db3867c..b6797cd 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -237,6 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) {
unsigned char inq[128];
int err;
+ memset (inq, 0, sizeof (inq));
scsi_cmd_set(udev, &sc, 0, 0x12);
scsi_cmd_set(udev, &sc, 4, 36);
scsi_cmd_set(udev, &sc, 5, 0);
@@ -265,6 +266,7 @@ static int cd_profiles(struct udev *udev, int fd)
unsigned int i;
int err;
+ memset (header, 0, sizeof (header));
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 1, 0);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
@@ -282,6 +284,7 @@ static int cd_profiles(struct udev *udev, int fd)
return -1;
}
+ memset (profiles, 0, sizeof (profiles));
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 1, 1);
scsi_cmd_set(udev, &sc, 6, len >> 16);
@@ -440,6 +443,7 @@ static int cd_media_info(struct udev *udev, int fd)
};
int err;
+ memset (header, 0, sizeof (header));
scsi_cmd_set(udev, &sc, 0, 0x51);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
@@ -472,6 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd)
unsigned char *p;
int err;
+ memset (header, 0, sizeof (header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, 1);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
@@ -493,6 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd)
if (len < 8)
return 0;
+ memset (toc, 0, sizeof (toc));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */
scsi_cmd_set(udev, &sc, 7, len >> 8);
@@ -520,6 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd)
cd_media_track_count_audio++;
}
+ memset (header, 0, sizeof (header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */
scsi_cmd_set(udev, &sc, 8, 12);
--
1.7.0.1

88
0066-cdrom_id.patch Normal file
View file

@ -0,0 +1,88 @@
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index b6797cd..afb481d 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -1,7 +1,7 @@
/*
* cdrom_id - optical drive and media information prober
*
- * Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -157,7 +157,7 @@ struct scsi_cmd {
static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, int arg)
{
if (i == 0) {
- memset(cmd, 0x00, sizeof(struct scsi_cmd));
+ memset(cmd, 0, sizeof(struct scsi_cmd));
cmd->cgc.quiet = 1;
cmd->cgc.sense = &cmd->_sense.s;
memset(&cmd->sg_io, 0, sizeof(cmd->sg_io));
@@ -237,7 +237,7 @@ static int cd_inquiry(struct udev *udev, int fd) {
unsigned char inq[128];
int err;
- memset (inq, 0, sizeof (inq));
+ memset(inq, 0, sizeof(inq));
scsi_cmd_set(udev, &sc, 0, 0x12);
scsi_cmd_set(udev, &sc, 4, 36);
scsi_cmd_set(udev, &sc, 5, 0);
@@ -266,7 +266,7 @@ static int cd_profiles(struct udev *udev, int fd)
unsigned int i;
int err;
- memset (header, 0, sizeof (header));
+ memset(header, 0, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 1, 0);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
@@ -284,7 +284,7 @@ static int cd_profiles(struct udev *udev, int fd)
return -1;
}
- memset (profiles, 0, sizeof (profiles));
+ memset(profiles, 0, sizeof(profiles));
scsi_cmd_set(udev, &sc, 0, 0x46);
scsi_cmd_set(udev, &sc, 1, 1);
scsi_cmd_set(udev, &sc, 6, len >> 16);
@@ -443,7 +443,7 @@ static int cd_media_info(struct udev *udev, int fd)
};
int err;
- memset (header, 0, sizeof (header));
+ memset(header, 0, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x51);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
@@ -476,7 +476,7 @@ static int cd_media_toc(struct udev *udev, int fd)
unsigned char *p;
int err;
- memset (header, 0, sizeof (header));
+ memset(header, 0, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, 1);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
@@ -498,7 +498,7 @@ static int cd_media_toc(struct udev *udev, int fd)
if (len < 8)
return 0;
- memset (toc, 0, sizeof (toc));
+ memset(toc, 0, sizeof(toc));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */
scsi_cmd_set(udev, &sc, 7, len >> 8);
@@ -526,7 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd)
cd_media_track_count_audio++;
}
- memset (header, 0, sizeof (header));
+ memset(header, 0, sizeof (header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */
scsi_cmd_set(udev, &sc, 8, 12);
--
1.7.0.1

View file

@ -0,0 +1,277 @@
From 0413a47ebfcd46ae43cb56ad508b2484bc97ff14 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 15 Apr 2010 20:07:07 +0200
Subject: [PATCH 067/110] cdrom_id: rework feature/profiles buffer parsing
---
extras/cdrom_id/cdrom_id.c | 156 +++++++++++++++++++++++++------------------
1 files changed, 91 insertions(+), 65 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index afb481d..3f9ca4c 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -154,19 +154,22 @@ struct scsi_cmd {
struct sg_io_hdr sg_io;
};
-static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, int arg)
+static void scsi_cmd_init(struct udev *udev, struct scsi_cmd *cmd, unsigned char *buf, size_t bufsize)
+{
+ memset(cmd, 0x00, sizeof(struct scsi_cmd));
+ memset(buf, 0x00, bufsize);
+ cmd->cgc.quiet = 1;
+ cmd->cgc.sense = &cmd->_sense.s;
+ memset(&cmd->sg_io, 0, sizeof(cmd->sg_io));
+ cmd->sg_io.interface_id = 'S';
+ cmd->sg_io.mx_sb_len = sizeof(cmd->_sense);
+ cmd->sg_io.cmdp = cmd->cgc.cmd;
+ cmd->sg_io.sbp = cmd->_sense.u;
+ cmd->sg_io.flags = SG_FLAG_LUN_INHIBIT | SG_FLAG_DIRECT_IO;
+}
+
+static void scsi_cmd_set(struct udev *udev, struct scsi_cmd *cmd, size_t i, unsigned char arg)
{
- if (i == 0) {
- memset(cmd, 0, sizeof(struct scsi_cmd));
- cmd->cgc.quiet = 1;
- cmd->cgc.sense = &cmd->_sense.s;
- memset(&cmd->sg_io, 0, sizeof(cmd->sg_io));
- cmd->sg_io.interface_id = 'S';
- cmd->sg_io.mx_sb_len = sizeof(cmd->_sense);
- cmd->sg_io.cmdp = cmd->cgc.cmd;
- cmd->sg_io.sbp = cmd->_sense.u;
- cmd->sg_io.flags = SG_FLAG_LUN_INHIBIT | SG_FLAG_DIRECT_IO;
- }
cmd->sg_io.cmd_len = i + 1;
cmd->cgc.cmd[i] = arg;
}
@@ -237,7 +240,7 @@ static int cd_inquiry(struct udev *udev, int fd) {
unsigned char inq[128];
int err;
- memset(inq, 0, sizeof(inq));
+ scsi_cmd_init(udev, &sc, inq, sizeof(inq));
scsi_cmd_set(udev, &sc, 0, 0x12);
scsi_cmd_set(udev, &sc, 4, 36);
scsi_cmd_set(udev, &sc, 5, 0);
@@ -256,109 +259,132 @@ static int cd_inquiry(struct udev *udev, int fd) {
return 0;
}
-static int cd_profiles(struct udev *udev, int fd)
+static int feature_profiles(struct udev *udev, const unsigned char *profiles, size_t size)
{
- struct scsi_cmd sc;
- unsigned char header[8];
- unsigned char profiles[512];
- unsigned int cur_profile;
- unsigned int len;
unsigned int i;
- int err;
-
- memset(header, 0, sizeof(header));
- scsi_cmd_set(udev, &sc, 0, 0x46);
- scsi_cmd_set(udev, &sc, 1, 0);
- scsi_cmd_set(udev, &sc, 8, sizeof(header));
- scsi_cmd_set(udev, &sc, 9, 0);
- err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
- if ((err < 0)) {
- info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
- return -1;
- }
- len = 4 + (header[0] << 24 | header[1] << 16 | header[2] << 8 | header[3]);
- info(udev, "GET CONFIGURATION: number of profiles %i\n", len);
- if (len > sizeof(profiles)) {
- info(udev, "invalid number of profiles\n");
- return -1;
- }
-
- memset(profiles, 0, sizeof(profiles));
- scsi_cmd_set(udev, &sc, 0, 0x46);
- scsi_cmd_set(udev, &sc, 1, 1);
- scsi_cmd_set(udev, &sc, 6, len >> 16);
- scsi_cmd_set(udev, &sc, 7, len >> 8);
- scsi_cmd_set(udev, &sc, 8, len);
- scsi_cmd_set(udev, &sc, 9, 0);
- err = scsi_cmd_run(udev, &sc, fd, profiles, len);
- if ((err < 0)) {
- info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
- return -1;
- }
-
- /* device profiles */
- for (i = 12; i < profiles[11]; i += 4) {
- unsigned int profile = (profiles[i] << 8 | profiles[i + 1]);
- if (profile == 0)
- continue;
- info(udev, "profile 0x%02x\n", profile);
+ for (i = 0; i+4 <= size; i += 4) {
+ int profile;
+ profile = profiles[i] << 8 | profiles[i+1];
switch (profile) {
case 0x03:
case 0x04:
case 0x05:
+ info(udev, "profile 0x%02x mo\n", profile);
cd_mo = 1;
- break;
+ break;
case 0x10:
+ info(udev, "profile 0x%02x dvd_rom\n", profile);
cd_dvd_rom = 1;
break;
case 0x12:
+ info(udev, "profile 0x%02x dvd_ram\n", profile);
cd_dvd_ram = 1;
break;
case 0x13:
case 0x14:
+ info(udev, "profile 0x%02x dvd_rw\n", profile);
cd_dvd_rw = 1;
break;
case 0x1B:
+ info(udev, "profile 0x%02x dvd_plus_r\n", profile);
cd_dvd_plus_r = 1;
break;
case 0x1A:
+ info(udev, "profile 0x%02x dvd_plus_rw\n", profile);
cd_dvd_plus_rw = 1;
break;
case 0x2A:
+ info(udev, "profile 0x%02x dvd_plus_rw_dl\n", profile);
cd_dvd_plus_rw_dl = 1;
break;
case 0x2B:
+ info(udev, "profile 0x%02x dvd_plus_r_dl\n", profile);
cd_dvd_plus_r_dl = 1;
break;
case 0x40:
cd_bd = 1;
+ info(udev, "profile 0x%02x bd\n", profile);
break;
case 0x41:
case 0x42:
cd_bd_r = 1;
+ info(udev, "profile 0x%02x bd_r\n", profile);
break;
case 0x43:
cd_bd_re = 1;
+ info(udev, "profile 0x%02x bd_re\n", profile);
break;
case 0x50:
cd_hddvd = 1;
+ info(udev, "profile 0x%02x hddvd\n", profile);
break;
case 0x51:
cd_hddvd_r = 1;
+ info(udev, "profile 0x%02x hddvd_r\n", profile);
break;
case 0x52:
cd_hddvd_rw = 1;
+ info(udev, "profile 0x%02x hddvd_rw\n", profile);
+ break;
+ default:
+ info(udev, "profile 0x%02x <ignored>\n", profile);
+ break;
+ }
+ }
+ return 0;
+}
+
+static int cd_profiles(struct udev *udev, int fd)
+{
+ struct scsi_cmd sc;
+ unsigned char features[65530];
+ unsigned int cur_profile = 0;
+ unsigned int len;
+ unsigned int i;
+ int err;
+
+ scsi_cmd_init(udev, &sc, features, sizeof(features));
+ scsi_cmd_set(udev, &sc, 0, 0x46);
+ scsi_cmd_set(udev, &sc, 7, (sizeof(features) >> 8) & 0xff);
+ scsi_cmd_set(udev, &sc, 8, sizeof(features) & 0xff);
+ scsi_cmd_set(udev, &sc, 9, 0);
+ err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features));
+ if ((err < 0)) {
+ info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
+ return -1;
+ }
+
+ len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3];
+ info(udev, "GET CONFIGURATION: size of features buffer %i\n", len);
+
+ if (len > sizeof(features)) {
+ info(udev, "can not get features in a single query, truncating\n");
+ len = sizeof(features);
+ }
+
+ /* device features */
+ for (i = 8; i+4 < len; i += (4 + features[i+3])) {
+ unsigned int feature;
+
+ feature = features[i] << 8 | features[i+1];
+
+ switch (feature) {
+ case 0x00:
+ info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4);
+ feature_profiles(udev, &features[i]+4, features[i+3]);
+
+ /* set current profile, if we got a profiles section */
+ cur_profile = features[6] << 8 | features[7];
+ info(udev, "current profile 0x%02x\n", cur_profile);
break;
default:
+ info(udev, "GET CONFIGURATION: feature %i <ignored>, with %i bytes\n", feature, features[i+3]);
break;
}
}
- /* current media profile */
- cur_profile = header[6] << 8 | header[7];
- info(udev, "current profile 0x%02x\n", cur_profile);
if (cur_profile == 0) {
info(udev, "no current profile, assuming no media\n");
return -1;
@@ -443,7 +469,7 @@ static int cd_media_info(struct udev *udev, int fd)
};
int err;
- memset(header, 0, sizeof(header));
+ scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x51);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
@@ -476,7 +502,7 @@ static int cd_media_toc(struct udev *udev, int fd)
unsigned char *p;
int err;
- memset(header, 0, sizeof(header));
+ scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, 1);
scsi_cmd_set(udev, &sc, 8, sizeof(header));
@@ -498,7 +524,7 @@ static int cd_media_toc(struct udev *udev, int fd)
if (len < 8)
return 0;
- memset(toc, 0, sizeof(toc));
+ scsi_cmd_init(udev, &sc, toc, sizeof(toc));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */
scsi_cmd_set(udev, &sc, 7, len >> 8);
@@ -526,7 +552,7 @@ static int cd_media_toc(struct udev *udev, int fd)
cd_media_track_count_audio++;
}
- memset(header, 0, sizeof (header));
+ scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */
scsi_cmd_set(udev, &sc, 8, 12);
--
1.7.0.1

View file

@ -0,0 +1,121 @@
From 2e9df1981833e1e029b7ce6c12a44dffb6aad0cb Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 15 Apr 2010 20:48:04 +0200
Subject: [PATCH 068/110] cdrom_id: print more debug messages
---
extras/cdrom_id/cdrom_id.c | 28 +++++++++++++++++++++++-----
1 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 3f9ca4c..d9b6fbd 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -374,10 +374,6 @@ static int cd_profiles(struct udev *udev, int fd)
case 0x00:
info(udev, "GET CONFIGURATION: feature 'profiles', with %i entries\n", features[i+3] / 4);
feature_profiles(udev, &features[i]+4, features[i+3]);
-
- /* set current profile, if we got a profiles section */
- cur_profile = features[6] << 8 | features[7];
- info(udev, "current profile 0x%02x\n", cur_profile);
break;
default:
info(udev, "GET CONFIGURATION: feature %i <ignored>, with %i bytes\n", feature, features[i+3]);
@@ -385,7 +381,10 @@ static int cd_profiles(struct udev *udev, int fd)
}
}
- if (cur_profile == 0) {
+ cur_profile = features[6] << 8 | features[7];
+ if (cur_profile > 0) {
+ info(udev, "current profile 0x%02x\n", cur_profile);
+ } else {
info(udev, "no current profile, assuming no media\n");
return -1;
}
@@ -396,62 +395,81 @@ static int cd_profiles(struct udev *udev, int fd)
case 0x03:
case 0x04:
case 0x05:
+ info(udev, "profile 0x%02x \n", cur_profile);
cd_media_mo = 1;
break;
case 0x08:
+ info(udev, "profile 0x%02x media_cd_rom\n", cur_profile);
cd_media_cd_rom = 1;
break;
case 0x09:
+ info(udev, "profile 0x%02x media_cd_r\n", cur_profile);
cd_media_cd_r = 1;
break;
case 0x0a:
+ info(udev, "profile 0x%02x media_cd_rw\n", cur_profile);
cd_media_cd_rw = 1;
break;
case 0x10:
+ info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile);
cd_media_dvd_rom = 1;
break;
case 0x11:
+ info(udev, "profile 0x%02x media_dvd_r\n", cur_profile);
cd_media_dvd_r = 1;
break;
case 0x12:
+ info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile);
cd_media_dvd_ram = 1;
break;
case 0x13:
case 0x14:
+ info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile);
cd_media_dvd_rw = 1;
break;
case 0x1B:
+ info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
cd_media_dvd_plus_r = 1;
break;
case 0x1A:
+ info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile);
cd_media_dvd_plus_rw = 1;
break;
case 0x2A:
+ info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile);
cd_media_dvd_plus_rw_dl = 1;
break;
case 0x2B:
+ info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile);
cd_media_dvd_plus_r_dl = 1;
break;
case 0x40:
+ info(udev, "profile 0x%02x media_bd\n", cur_profile);
cd_media_bd = 1;
break;
case 0x41:
case 0x42:
+ info(udev, "profile 0x%02x media_bd_r\n", cur_profile);
cd_media_bd_r = 1;
break;
case 0x43:
+ info(udev, "profile 0x%02x media_bd_re\n", cur_profile);
cd_media_bd_re = 1;
break;
case 0x50:
+ info(udev, "profile 0x%02x media_hddvd\n", cur_profile);
cd_media_hddvd = 1;
break;
case 0x51:
+ info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile);
cd_media_hddvd_r = 1;
break;
case 0x52:
+ info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile);
cd_media_hddvd_rw = 1;
break;
default:
+ info(udev, "profile 0x%02x <ignored>\n", cur_profile);
break;
}
return 0;
--
1.7.0.1

View file

@ -0,0 +1,25 @@
From 140647ad1aec50e2f657e7838e893a87404ff83a Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 15 Apr 2010 21:18:21 +0200
Subject: [PATCH 069/110] cdrom_id: debug - print feature values in hex
---
extras/cdrom_id/cdrom_id.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index d9b6fbd..b2c107b 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -376,7 +376,7 @@ static int cd_profiles(struct udev *udev, int fd)
feature_profiles(udev, &features[i]+4, features[i+3]);
break;
default:
- info(udev, "GET CONFIGURATION: feature %i <ignored>, with %i bytes\n", feature, features[i+3]);
+ info(udev, "GET CONFIGURATION: feature 0x%04x <ignored>, with 0x%02x bytes\n", feature, features[i+3]);
break;
}
}
--
1.7.0.1

View file

@ -0,0 +1,25 @@
From a60b077a465b19af2efd9bf0cb5f0f67117be780 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 15 Apr 2010 21:22:38 +0200
Subject: [PATCH 070/110] cdrom_id: debug - print feature values in hex
---
extras/cdrom_id/cdrom_id.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index b2c107b..16b1260 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -357,7 +357,7 @@ static int cd_profiles(struct udev *udev, int fd)
}
len = features[0] << 24 | features[1] << 16 | features[2] << 8 | features[3];
- info(udev, "GET CONFIGURATION: size of features buffer %i\n", len);
+ info(udev, "GET CONFIGURATION: size of features buffer 0x%04x\n", len);
if (len > sizeof(features)) {
info(udev, "can not get features in a single query, truncating\n");
--
1.7.0.1

View file

@ -0,0 +1,79 @@
From 58e178894bfc040834e1270c6fe9b9fdef513550 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 15 Apr 2010 08:56:48 +0200
Subject: [PATCH 071/110] cdrom_id: Do not ignore errors from scsi_cmd_run()
scsi_cmd_run() can return positive error messages if we have CHECK_CONDITION
set and get the error code from the SCSI command result. So check the result
for non-zero, not for being negative.
This should fix another cause for "phantom" media in empty CD-ROM drives.
Thanks to Mike Brudevold <mike@brudevold.com> for spotting this!
https://launchpad.net/bugs/562978
---
extras/cdrom_id/cdrom_id.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 16b1260..37212e9 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -245,7 +245,7 @@ static int cd_inquiry(struct udev *udev, int fd) {
scsi_cmd_set(udev, &sc, 4, 36);
scsi_cmd_set(udev, &sc, 5, 0);
err = scsi_cmd_run(udev, &sc, fd, inq, 36);
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "INQUIRY", err);
return -1;
}
@@ -351,7 +351,7 @@ static int cd_profiles(struct udev *udev, int fd)
scsi_cmd_set(udev, &sc, 8, sizeof(features) & 0xff);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features));
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
return -1;
}
@@ -492,7 +492,7 @@ static int cd_media_info(struct udev *udev, int fd)
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "READ DISC INFORMATION", err);
return -1;
};
@@ -526,7 +526,7 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "READ TOC", err);
return -1;
}
@@ -549,7 +549,7 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_set(udev, &sc, 8, len);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, toc, len);
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "READ TOC (tracks)", err);
return -1;
}
@@ -576,7 +576,7 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_set(udev, &sc, 8, 12);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
- if ((err < 0)) {
+ if ((err != 0)) {
info_scsi_cmd_err(udev, "READ TOC (multi session)", err);
return -1;
}
--
1.7.0.1

View file

@ -0,0 +1,38 @@
From 30e3b1a0d3a3ec76f16736470dc656744848d941 Mon Sep 17 00:00:00 2001
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 15 Apr 2010 21:25:57 +0200
Subject: [PATCH 072/110] cdrom_id: Swap media state and TOC info probing
Blank CDs do not have a TOC, thus will fail cd_media_toc() (at least with the
"Do not ignore errors from scsi_cmd_run()" fix). Thus probe the media state
first, so that we can properly detect blank media.
---
extras/cdrom_id/cdrom_id.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 37212e9..722b8f8 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -681,14 +681,14 @@ int main(int argc, char *argv[])
if (cd_profiles(udev, fd) < 0)
goto print;
- /* get session/track info */
- if (cd_media_toc(udev, fd) < 0)
- goto print;
-
/* get writable media state */
if (cd_media_info(udev, fd) < 0)
goto print;
+ /* get session/track info */
+ if (cd_media_toc(udev, fd) < 0)
+ goto print;
+
print:
printf("ID_CDROM=1\n");
if (cd_cd_rom)
--
1.7.0.1

View file

@ -0,0 +1,36 @@
From 7c07740ce7b0941844b15573449a730283d5bba5 Mon Sep 17 00:00:00 2001
From: Mike Brudevold <mike@brudevold.com>
Date: Thu, 15 Apr 2010 19:55:50 -0500
Subject: [PATCH 074/110] cdrom_id: add missing profiles to feature_profiles
Signed-off-by: Mike Brudevold <mike@brudevold.com>
---
extras/cdrom_id/cdrom_id.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 722b8f8..da2785e 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -274,6 +274,18 @@ static int feature_profiles(struct udev *udev, const unsigned char *profiles, si
info(udev, "profile 0x%02x mo\n", profile);
cd_mo = 1;
break;
+ case 0x08:
+ info(udev, "profile 0x%02x cd_rom\n", profile);
+ cd_cd_rom = 1;
+ break;
+ case 0x09:
+ info(udev, "profile 0x%02x cd_r\n", profile);
+ cd_cd_r = 1;
+ break;
+ case 0x0A:
+ info(udev, "profile 0x%02x cd_rw\n", profile);
+ cd_cd_rw = 1;
+ break;
case 0x10:
info(udev, "profile 0x%02x dvd_rom\n", profile);
cd_dvd_rom = 1;
--
1.7.0.1

View file

@ -0,0 +1,183 @@
From bc913ce47821ed030437ec9b25507b5dd52b59cb Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Sat, 17 Apr 2010 19:31:44 +0200
Subject: [PATCH 075/110] cdrom_id: set ID_CDROM_MEDIA=1 only for known media
On Sat, Apr 17, 2010 at 18:26, Mike Brudevold <mike@brudevold.com> wrote:
> My CD-RW drive experiences a problem in that it automatically closes
> after opening if there is media in the drive. This only happens if
> there was media in the drive when it was last closed (an empty drive
> stays open).
...
> cd_profiles: current profile 0x02
> cd_profiles: profile 0x02 <ignored>
...
Do not pretend to have a media, when we receive a profile like 0x02,
which just means "Removable disk".
Thanks to Mike Brudevold for the initial patch.
---
extras/cdrom_id/cdrom_id.c | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index da2785e..935f117 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -401,83 +401,99 @@ static int cd_profiles(struct udev *udev, int fd)
return -1;
}
- cd_media = 1;
-
switch (cur_profile) {
case 0x03:
case 0x04:
case 0x05:
info(udev, "profile 0x%02x \n", cur_profile);
+ cd_media = 1;
cd_media_mo = 1;
break;
case 0x08:
info(udev, "profile 0x%02x media_cd_rom\n", cur_profile);
+ cd_media = 1;
cd_media_cd_rom = 1;
break;
case 0x09:
info(udev, "profile 0x%02x media_cd_r\n", cur_profile);
+ cd_media = 1;
cd_media_cd_r = 1;
break;
case 0x0a:
info(udev, "profile 0x%02x media_cd_rw\n", cur_profile);
+ cd_media = 1;
cd_media_cd_rw = 1;
break;
case 0x10:
info(udev, "profile 0x%02x media_dvd_ro\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_rom = 1;
break;
case 0x11:
info(udev, "profile 0x%02x media_dvd_r\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_r = 1;
break;
case 0x12:
info(udev, "profile 0x%02x media_dvd_ram\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_ram = 1;
break;
case 0x13:
case 0x14:
info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_rw = 1;
break;
case 0x1B:
info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_plus_r = 1;
break;
case 0x1A:
info(udev, "profile 0x%02x media_dvd_plus_rw\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_plus_rw = 1;
break;
case 0x2A:
info(udev, "profile 0x%02x media_dvd_plus_rw_dl\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_plus_rw_dl = 1;
break;
case 0x2B:
info(udev, "profile 0x%02x media_dvd_plus_r_dl\n", cur_profile);
+ cd_media = 1;
cd_media_dvd_plus_r_dl = 1;
break;
case 0x40:
info(udev, "profile 0x%02x media_bd\n", cur_profile);
+ cd_media = 1;
cd_media_bd = 1;
break;
case 0x41:
case 0x42:
info(udev, "profile 0x%02x media_bd_r\n", cur_profile);
+ cd_media = 1;
cd_media_bd_r = 1;
break;
case 0x43:
info(udev, "profile 0x%02x media_bd_re\n", cur_profile);
+ cd_media = 1;
cd_media_bd_re = 1;
break;
case 0x50:
info(udev, "profile 0x%02x media_hddvd\n", cur_profile);
+ cd_media = 1;
cd_media_hddvd = 1;
break;
case 0x51:
info(udev, "profile 0x%02x media_hddvd_r\n", cur_profile);
+ cd_media = 1;
cd_media_hddvd_r = 1;
break;
case 0x52:
info(udev, "profile 0x%02x media_hddvd_rw\n", cur_profile);
+ cd_media = 1;
cd_media_hddvd_rw = 1;
break;
default:
@@ -501,7 +517,7 @@ static int cd_media_info(struct udev *udev, int fd)
scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x51);
- scsi_cmd_set(udev, &sc, 8, sizeof(header));
+ scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
if ((err != 0)) {
@@ -509,10 +525,11 @@ static int cd_media_info(struct udev *udev, int fd)
return -1;
};
+ cd_media = 1;
info(udev, "disk type %02x\n", header[8]);
/* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */
- if (!cd_media_cd_rom && (header[2] & 3) < 4)
+ if (!cd_media_cd_rom)
cd_media_state = media_status[header[2] & 3];
if ((header[2] & 3) != 2)
@@ -535,7 +552,7 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, 1);
- scsi_cmd_set(udev, &sc, 8, sizeof(header));
+ scsi_cmd_set(udev, &sc, 8, sizeof(header) & 0xff);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
if ((err != 0)) {
@@ -557,8 +574,8 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_init(udev, &sc, toc, sizeof(toc));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 6, header[2]); /* First Track/Session Number */
- scsi_cmd_set(udev, &sc, 7, len >> 8);
- scsi_cmd_set(udev, &sc, 8, len);
+ scsi_cmd_set(udev, &sc, 7, (len >> 8) & 0xff);
+ scsi_cmd_set(udev, &sc, 8, len & 0xff);
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, toc, len);
if ((err != 0)) {
@@ -585,7 +602,7 @@ static int cd_media_toc(struct udev *udev, int fd)
scsi_cmd_init(udev, &sc, header, sizeof(header));
scsi_cmd_set(udev, &sc, 0, 0x43);
scsi_cmd_set(udev, &sc, 2, 1); /* Session Info */
- scsi_cmd_set(udev, &sc, 8, 12);
+ scsi_cmd_set(udev, &sc, 8, sizeof(header));
scsi_cmd_set(udev, &sc, 9, 0);
err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
if ((err != 0)) {
--
1.7.0.1

View file

@ -0,0 +1,26 @@
From 155e313bfda594b3d8e2a31d48f341765bdfa75d Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 27 Apr 2010 12:22:42 +0200
Subject: [PATCH 110/110] cdrom_id: only mark sr[0-9]* as ID_CDROM
we cannot be sure for xvd*
---
extras/cdrom_id/60-cdrom_id.rules | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules
index 16b3af9..b3109f1 100644
--- a/extras/cdrom_id/60-cdrom_id.rules
+++ b/extras/cdrom_id/60-cdrom_id.rules
@@ -5,7 +5,7 @@ SUBSYSTEM!="block", GOTO="cdrom_end"
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
-ENV{ID_CDROM}="1"
+KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
IMPORT{program}="cdrom_id --export $tempnode"
LABEL="cdrom_end"
--
1.7.0.1

View file

@ -1,6 +0,0 @@
# Makefile for source rpm: udev
# $Id$
NAME := udev
SPECFILE = $(firstword $(wildcard *.spec))
include ../common/Makefile.common

6
Makefile.git Normal file
View file

@ -0,0 +1,6 @@
Patch:
@for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "Patch$$n: $$i";done
patch:
@for i in 00*.patch; do n=$$[$$(echo $$i|cut -f 1 -d '-'|sed -e 's#^0*##')]; echo "%patch$$n -p1 -b .git$$n";done

295
ck-runseat.patch Normal file
View file

@ -0,0 +1,295 @@
--- udev-145/extras/udev-acl/Makefile.am.runseat 2009-06-16 19:47:37.000000000 -0400
+++ udev-145/extras/udev-acl/Makefile.am 2009-09-25 20:21:41.959583372 -0400
@@ -15,5 +15,5 @@ udev_acl_LDADD = \
dist_udevrules_DATA = 70-acl.rules
install-exec-hook:
- mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d
- ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-session.d/udev-acl.ck
+ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
+ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
--- udev-145/extras/udev-acl/udev-acl.c.runseat 2009-06-16 12:10:58.000000000 -0400
+++ udev-145/extras/udev-acl/udev-acl.c 2009-09-25 20:57:32.502573825 -0400
@@ -1,4 +1,5 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
* Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
*
* This program is free software; you can redistribute it and/or
@@ -29,6 +30,13 @@
static int debug;
+enum{
+ ACTION_NONE = 0,
+ ACTION_REMOVE,
+ ACTION_ADD,
+ ACTION_CHANGE
+};
+
static int set_facl(const char* filename, uid_t uid, int add)
{
int get;
@@ -152,44 +160,123 @@ static GSList *uids_with_local_active_se
}
/* ConsoleKit calls us with special variables */
-static int consolekit_called(const char *action, uid_t *uid, const char **own_session, int *add)
+static int consolekit_called(const char *ck_action, uid_t *uid, uid_t *uid2, const char **remove_session_id, int *action)
{
- int a;
- uid_t u;
+ int a = ACTION_NONE;
+ uid_t u = 0;
+ uid_t u2 = 0;
const char *s;
- const char *session;
-
- if (action == NULL || strcmp(action, "session_active_changed") != 0)
- return -1;
+ const char *s2;
+ const char *old_session = NULL;
- s = getenv("CK_SESSION_IS_LOCAL");
- if (s == NULL)
+ if (ck_action == NULL || strcmp(ck_action, "seat_active_session_changed") != 0)
return -1;
- if (strcmp(s, "true") != 0)
- return 0;
- s = getenv("CK_SESSION_IS_ACTIVE");
- if (s == NULL)
+ /* We can have one of: remove, add, change, no-change */
+ s = getenv("CK_SEAT_OLD_SESSION_ID");
+ s2 = getenv("CK_SEAT_SESSION_ID");
+ if (s == NULL && s2 == NULL) {
return -1;
- if (strcmp(s, "true") == 0)
- a = 1;
- else
- a = 0;
+ } else if (s2 == NULL) {
+ a = ACTION_REMOVE;
+ } else if (s == NULL) {
+ a = ACTION_ADD;
+ } else {
+ a = ACTION_CHANGE;
+ }
- session = getenv("CK_SESSION_ID");
- if (session == NULL)
- return -1;
+ switch (a) {
+ case ACTION_ADD:
+ s = getenv("CK_SEAT_SESSION_USER_UID");
+ if (s == NULL)
+ return -1;
+ u = strtoul(s, NULL, 10);
+ if (u == 0)
+ return 0;
+
+ s = getenv("CK_SEAT_SESSION_IS_LOCAL");
+ if (s == NULL)
+ return -1;
+ if (strcmp(s, "true") != 0)
+ return 0;
+
+ break;
+ case ACTION_REMOVE:
+ s = getenv("CK_SEAT_OLD_SESSION_USER_UID");
+ if (s == NULL)
+ return -1;
+ u = strtoul(s, NULL, 10);
+ if (u == 0)
+ return 0;
+
+ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL");
+ if (s == NULL)
+ return -1;
+ if (strcmp(s, "true") != 0)
+ return 0;
+
+ old_session = getenv("CK_SEAT_OLD_SESSION_ID");
+ if (old_session == NULL)
+ return -1;
+
+ break;
+ case ACTION_CHANGE:
+ s = getenv("CK_SEAT_OLD_SESSION_USER_UID");
+ if (s == NULL)
+ return -1;
+ u = strtoul(s, NULL, 10);
+ if (u == 0)
+ return 0;
+ s = getenv("CK_SEAT_SESSION_USER_UID");
+ if (s == NULL)
+ return -1;
+ u2 = strtoul(s, NULL, 10);
+ if (u2 == 0)
+ return 0;
+
+ s = getenv("CK_SEAT_OLD_SESSION_IS_LOCAL");
+ s2 = getenv("CK_SEAT_SESSION_IS_LOCAL");
+ if (s == NULL || s2 == NULL)
+ return -1;
+ /* don't process non-local session changes */
+ if (strcmp(s, "true") != 0 && strcmp(s2, "true") != 0)
+ return 0;
+
+ if (strcmp(s, "true") == 0 && strcmp(s, "true") == 0) {
+ /* process the change */
+ if (u == u2) {
+ /* special case: we noop if we are
+ * changing between local sessions for
+ * the same uid */
+ a = ACTION_NONE;
+ }
+ old_session = getenv("CK_SEAT_OLD_SESSION_ID");
+ if (old_session == NULL)
+ return -1;
+ } else if (strcmp(s, "true") == 0) {
+ /* only process the removal */
+ a = ACTION_REMOVE;
+ old_session = getenv("CK_SEAT_OLD_SESSION_ID");
+ if (old_session == NULL)
+ return -1;
+ } else if (strcmp(s2, "true") == 0) {
+ /* only process the addition */
+ a = ACTION_ADD;
+ u = u2;
+ }
- s = getenv("CK_SESSION_USER_UID");
- if (s == NULL)
- return -1;
- u = strtoul(s, NULL, 10);
- if (u == 0)
- return 0;
+ break;
+ case ACTION_NONE:
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
- *own_session = session;
+ *remove_session_id = old_session;
*uid = u;
- *add = a;
+ *uid2 = u2;
+ *action = a;
return 0;
}
@@ -223,6 +310,21 @@ static void apply_acl_to_devices(uid_t u
udev_unref(udev);
}
+static void
+remove_uid (uid_t uid, const char *remove_session_id)
+{
+ /*
+ * Remove ACL for given uid from all matching devices
+ * when there is currently no local active session.
+ */
+ GSList *list;
+
+ list = uids_with_local_active_session(remove_session_id);
+ if (!uid_in_list(list, uid))
+ apply_acl_to_devices(uid, 0);
+ g_slist_free(list);
+}
+
int main (int argc, char* argv[])
{
static const struct option options[] = {
@@ -233,10 +335,11 @@ int main (int argc, char* argv[])
{ "help", no_argument, NULL, 'h' },
{}
};
- int add = -1;
+ int action = -1;
const char *device = NULL;
uid_t uid = 0;
- const char* own_session = NULL;
+ uid_t uid2 = 0;
+ const char* remove_session_id = NULL;
int rc = 0;
/* valgrind is more important to us than a slice allocator */
@@ -252,9 +355,9 @@ int main (int argc, char* argv[])
switch (option) {
case 'a':
if (strcmp(optarg, "add") == 0 || strcmp(optarg, "change") == 0)
- add = 1;
+ action = ACTION_ADD;
else if (strcmp(optarg, "remove") == 0)
- add = 0;
+ action = ACTION_REMOVE;
else
goto out;
break;
@@ -274,10 +377,10 @@ int main (int argc, char* argv[])
}
}
- if (add < 0 && device == NULL && uid == 0)
- consolekit_called(argv[optind], &uid, &own_session, &add);
+ if (action < 0 && device == NULL && uid == 0)
+ consolekit_called(argv[optind], &uid, &uid2, &remove_session_id, &action);
- if (add < 0) {
+ if (action < 0) {
fprintf(stderr, "missing action\n\n");
rc = 2;
goto out;
@@ -290,20 +393,24 @@ int main (int argc, char* argv[])
}
if (uid != 0) {
- if (add) {
+ switch (action) {
+ case ACTION_ADD:
/* Add ACL for given uid to all matching devices. */
apply_acl_to_devices(uid, 1);
- } else {
- /*
- * Remove ACL for given uid from all matching devices
- * when there is currently no local active session.
- */
- GSList *list;
-
- list = uids_with_local_active_session(own_session);
- if (!uid_in_list(list, uid))
- apply_acl_to_devices(uid, 0);
- g_slist_free(list);
+ break;
+ case ACTION_REMOVE:
+ remove_uid(uid, remove_session_id);
+ break;
+ case ACTION_CHANGE:
+ remove_uid(uid, remove_session_id);
+ apply_acl_to_devices(uid2, 1);
+ break;
+ case ACTION_NONE:
+ goto out;
+ break;
+ default:
+ g_assert_not_reached();
+ break;
}
} else if (device != NULL) {
/*
@@ -321,8 +428,8 @@ int main (int argc, char* argv[])
uid_t u;
u = GPOINTER_TO_UINT(l->data);
- if (add || !uid_in_list(list, u))
- set_facl(device, u, add);
+ if (action == ACTION_ADD || !uid_in_list(list, u))
+ set_facl(device, u, action == ACTION_ADD);
}
g_slist_free(list);
} else {

25
fw_unit_symlinks.sh Normal file
View file

@ -0,0 +1,25 @@
#!/bin/sh
SYSFS=/sys
NAME=$1
NUM=$2
for i in "${SYSFS}${DEVPATH}/${NAME}.*/specifier_id"; do
if [ ! -f "$i" ]; then
continue
fi
SPECID="`cat $i`"
if [ $((SPECID)) -eq $((0x00609e)) ]; then
echo -n "sbp2-${NUM} "
elif [ $((SPECID)) -eq $((0x00a02d)) ]; then
SWVER="`cat ${i%/specifier_id}/version`"
if [ $((SWVER)) -ge $((0x100)) -a $((SWVER)) -lt $((0x110)) ]; then
echo -n "iidc${NUM} "
elif [ $((SWVER)) -eq $((0x10001)) ]; then
echo -n "avc${NUM} "
elif [ $((SWVER)) -ge $((0x14000)) -a $((SWVER)) -le $((0x14001)) ]; then
echo -n "vendorfw${NUM} "
fi
fi
done
echo

624
hid2hci.patch Normal file
View file

@ -0,0 +1,624 @@
diff -u udev-145/extras/hid2hci/70-hid2hci.rules /home/harald/git/udev/extras/hid2hci/70-hid2hci.rules
--- udev-145/extras/hid2hci/70-hid2hci.rules 2009-06-28 02:07:53.000000000 +0200
+++ udev/extras/hid2hci/70-hid2hci.rules 2009-09-16 16:48:40.000000000 +0200
@@ -1,25 +1,28 @@
# do not edit this file, it will be overwritten on update
-ACTION!="add", GOTO="hid2hci_end"
+ACTION!="add|change", GOTO="hid2hci_end"
SUBSYSTEM!="usb", GOTO="hid2hci_end"
-# Variety of Dell Bluetooth devices - it looks like a bit of an odd rule,
-# because it is matching on a mouse device that is self powered, but that
-# is where a HID report needs to be sent to switch modes.
-#
+# Variety of Dell Bluetooth devices - match on a mouse device that is
+# self powered and where a HID report needs to be sent to switch modes
# Known supported devices: 413c:8154, 413c:8158, 413c:8162
-ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
- RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", \
+ ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
+ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1"
+
+# Logitech devices (hidraw)
+KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \
+ RUN+="hid2hci --method=logitech-hid --devpath=%p"
ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"
-# Logitech devices
-ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-
-# CSR devices (in HID mode)
-ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+# When a Dell device recovers from S3, the mouse child needs to be repoked
+# Unfortunately the only event seen is the BT device disappearing, so the mouse
+# device needs to be chased down on the USB bus.
+ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \
+ ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"
+
+# CSR devices
+ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p"
LABEL="hid2hci_end"
diff -u udev-145/extras/hid2hci/hid2hci.c /home/harald/git/udev/extras/hid2hci/hid2hci.c
--- udev-145/extras/hid2hci/hid2hci.c 2009-06-13 02:55:10.000000000 +0200
+++ udev/extras/hid2hci/hid2hci.c 2009-08-13 11:23:30.000000000 +0200
@@ -1,31 +1,26 @@
/*
+ * hid2hci : switch the radio on devices that support
+ * it from HID to HCI and back
*
- * hid2hci : a tool for switching the radio on devices that support
- * it from HID to HCI and back
+ * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
+ * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
*
- * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
- * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
@@ -33,79 +28,24 @@
#include <string.h>
#include <getopt.h>
#include <sys/ioctl.h>
-
+#include <linux/hiddev.h>
#include <usb.h>
-#ifdef NEED_USB_GET_BUSSES
-static inline struct usb_bus *usb_get_busses(void)
-{
- return usb_busses;
-}
-#endif
-
-#ifndef USB_DIR_OUT
-#define USB_DIR_OUT 0x00
-#endif
-
-static char devpath[PATH_MAX + 1] = "/dev";
-
-struct hiddev_devinfo {
- unsigned int bustype;
- unsigned int busnum;
- unsigned int devnum;
- unsigned int ifnum;
- short vendor;
- short product;
- short version;
- unsigned num_applications;
-};
-
-struct hiddev_report_info {
- unsigned report_type;
- unsigned report_id;
- unsigned num_fields;
-};
-
-typedef __signed__ int __s32;
+#include "libudev.h"
+#include "libudev-private.h"
-struct hiddev_usage_ref {
- unsigned report_type;
- unsigned report_id;
- unsigned field_index;
- unsigned usage_index;
- unsigned usage_code;
- __s32 value;
+enum mode {
+ HCI = 0,
+ HID = 1,
};
-#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
-#define HIDIOCINITREPORT _IO('H', 0x05)
-#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
-#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
-
-#define HID_REPORT_TYPE_OUTPUT 2
-
-#define HCI 0
-#define HID 1
-
-struct device_info {
- struct usb_device *dev;
- int mode;
- uint16_t vendor;
- uint16_t product;
-};
-
-static int switch_csr(struct device_info *devinfo)
+static int usb_switch_csr(struct usb_dev_handle *dev, enum mode mode)
{
- struct usb_dev_handle *udev;
int err;
- udev = usb_open(devinfo->dev);
- if (!udev)
- return -errno;
-
- err = usb_control_msg(udev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0, devinfo->mode, 0, NULL, 0, 10000);
-
+ err = usb_control_msg(dev,
+ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, mode, 0, NULL, 0, 10000);
if (err == 0) {
err = -1;
errno = EALREADY;
@@ -113,13 +53,10 @@
if (errno == ETIMEDOUT)
err = 0;
}
-
- usb_close(udev);
-
return err;
}
-static int send_report(int fd, const char *buf, size_t size)
+static int hid_logitech_send_report(int fd, const char *buf, size_t size)
{
struct hiddev_report_info rinfo;
struct hiddev_usage_ref uref;
@@ -148,72 +85,42 @@
return err;
}
-static int switch_logitech(struct device_info *devinfo)
+static int hid_switch_logitech(const char *filename)
{
- char devname[PATH_MAX + 1];
- int i, fd, err = -1;
-
- for (i = 0; i < 16; i++) {
- struct hiddev_devinfo dinfo;
- char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
- char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
- char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
-
- sprintf(devname, "%s/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0) {
- sprintf(devname, "%s/usb/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0) {
- sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0)
- continue;
- }
- }
-
- memset(&dinfo, 0, sizeof(dinfo));
- err = ioctl(fd, HIDIOCGDEVINFO, &dinfo);
- if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) ||
- (int) dinfo.devnum != atoi(devinfo->dev->filename)) {
- close(fd);
- continue;
- }
-
- err = ioctl(fd, HIDIOCINITREPORT, 0);
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep1, sizeof(rep1));
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep2, sizeof(rep2));
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep3, sizeof(rep3));
- close(fd);
- break;
- }
-
+ char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
+ char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
+ char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
+ int fd;
+ int err = -1;
+
+ fd = open(filename, O_RDWR);
+ if (fd < 0)
+ return err;
+
+ err = ioctl(fd, HIDIOCINITREPORT, 0);
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep1, sizeof(rep1));
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep2, sizeof(rep2));
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep3, sizeof(rep3));
+out:
+ close(fd);
return err;
}
-static int switch_dell(struct device_info *devinfo)
+static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode)
{
char report[] = { 0x7f, 0x00, 0x00, 0x00 };
-
- struct usb_dev_handle *handle;
int err;
- switch (devinfo->mode) {
+ switch (mode) {
case HCI:
report[1] = 0x13;
break;
@@ -222,22 +129,16 @@
break;
}
- handle = usb_open(devinfo->dev);
- if (!handle)
- return -EIO;
-
/* Don't need to check return, as might not be in use */
- usb_detach_kernel_driver_np(handle, 0);
+ usb_detach_kernel_driver_np(dev, 0);
- if (usb_claim_interface(handle, 0) < 0) {
- usb_close(handle);
+ if (usb_claim_interface(dev, 0) < 0)
return -EIO;
- }
- err = usb_control_msg(handle,
- USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ err = usb_control_msg(dev,
+ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0,
- report, sizeof(report), 5000);
+ report, sizeof(report), 5000);
if (err == 0) {
err = -1;
@@ -246,131 +147,203 @@
if (errno == ETIMEDOUT)
err = 0;
}
-
- usb_close(handle);
-
return err;
}
-static int find_device(struct device_info* devinfo)
+/*
+ * The braindead libusb needs to scan and open all devices, just to
+ * to find the device we already have. This needs to be fixed in libusb
+ * or it will be ripped out and we carry our own code.
+ */
+static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev)
{
struct usb_bus *bus;
- struct usb_device *dev;
+ const char *str;
+ int busnum;
+ int devnum;
+
+ str = udev_device_get_sysattr_value(usb_dev, "busnum");
+ if (str == NULL)
+ return NULL;
+ busnum = strtol(str, NULL, 0);
+
+ str = udev_device_get_sysattr_value(usb_dev, "devnum");
+ if (str == NULL)
+ return NULL;
+ devnum = strtol(str, NULL, 0);
+ usb_init();
usb_find_busses();
usb_find_devices();
- for (bus = usb_get_busses(); bus; bus = bus->next)
+ for (bus = usb_get_busses(); bus; bus = bus->next) {
+ struct usb_device *dev;
+
+ if (strtol(bus->dirname, NULL, 10) != busnum)
+ continue;
+
for (dev = bus->devices; dev; dev = dev->next) {
- if (dev->descriptor.idVendor == devinfo->vendor &&
- dev->descriptor.idProduct == devinfo->product) {
- devinfo->dev=dev;
- return 1;
- }
+ if (dev->devnum == devnum)
+ return dev;
}
- return 0;
+ }
+
+ return NULL;
+}
+
+static struct usb_dev_handle *find_device(struct udev_device *udev_dev)
+{
+ struct usb_device *dev;
+
+ dev = usb_device_open_from_udev(udev_dev);
+ if (dev == NULL)
+ return NULL;
+ return usb_open(dev);
}
-static void usage(char* error)
+static void usage(const char *error)
{
if (error)
fprintf(stderr,"\n%s\n", error);
else
printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n");
- printf("Usage:\n"
- "\thid2hci [options]\n"
- "\n");
-
- printf("Options:\n"
- "\t-h, --help Display help\n"
- "\t-q, --quiet Don't display any messages\n"
- "\t-r, --mode= Mode to switch to [hid, hci]\n"
- "\t-v, --vendor= Vendor ID to act upon\n"
- "\t-p, --product= Product ID to act upon\n"
- "\t-m, --method= Method to use to switch [csr, logitech, dell]\n"
- "\n");
- if (error)
- exit(1);
+ printf("Usage: hid2hci [options]\n"
+ " --mode= mode to switch to [hid|hci] (default hci)\n"
+ " --devpath= sys device path\n"
+ " --method= method to use to switch [csr|logitech-hid|dell]\n"
+ " --help\n\n");
}
-static const struct option main_options[] = {
- { "help", no_argument, 0, 'h' },
- { "quiet", no_argument, 0, 'q' },
- { "mode", required_argument, 0, 'r' },
- { "vendor", required_argument, 0, 'v' },
- { "product", required_argument, 0, 'p' },
- { "method", required_argument, 0, 'm' },
- { 0, 0, 0, 0 }
-};
-
int main(int argc, char *argv[])
{
- struct device_info dev = { NULL, HCI, 0, 0 };
- int opt, quiet = 0;
- int (*method)(struct device_info *dev) = NULL;
-
- while ((opt = getopt_long(argc, argv, "+r:v:p:m:qh", main_options, NULL)) != -1) {
- switch (opt) {
- case 'r':
- if (optarg && !strcmp(optarg, "hid"))
- dev.mode = HID;
- else if (optarg && !strcmp(optarg, "hci"))
- dev.mode = HCI;
- else
- usage("ERROR: Undefined radio mode\n");
+ static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
+ { "mode", required_argument, NULL, 'm' },
+ { "devpath", required_argument, NULL, 'p' },
+ { "method", required_argument, NULL, 'M' },
+ { }
+ };
+ enum method {
+ METHOD_UNDEF,
+ METHOD_CSR,
+ METHOD_LOGITECH_HID,
+ METHOD_DELL,
+ } method = METHOD_UNDEF;
+ struct udev *udev;
+ struct udev_device *udev_dev = NULL;
+ char syspath[UTIL_PATH_SIZE];
+ int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL;
+ enum mode mode = HCI;
+ const char *devpath = NULL;
+ int err = -1;
+ int rc = 1;
+
+ for (;;) {
+ int option;
+
+ option = getopt_long(argc, argv, "m:p:M:qh", options, NULL);
+ if (option == -1)
break;
- case 'v':
- sscanf(optarg, "%4hx", &dev.vendor);
+
+ switch (option) {
+ case 'm':
+ if (!strcmp(optarg, "hid")) {
+ mode = HID;
+ } else if (!strcmp(optarg, "hci")) {
+ mode = HCI;
+ } else {
+ usage("error: undefined radio mode\n");
+ exit(1);
+ }
break;
case 'p':
- sscanf(optarg, "%4hx", &dev.product);
- break;
- case 'm':
- if (optarg && !strcmp(optarg, "csr"))
- method = switch_csr;
- else if (optarg && !strcmp(optarg, "logitech"))
- method = switch_logitech;
- else if (optarg && !strcmp(optarg, "dell"))
- method = switch_dell;
- else
- usage("ERROR: Undefined switching method\n");
+ devpath = optarg;
break;
- case 'q':
- quiet = 1;
+ case 'M':
+ if (!strcmp(optarg, "csr")) {
+ method = METHOD_CSR;
+ usb_switch = usb_switch_csr;
+ } else if (!strcmp(optarg, "logitech-hid")) {
+ method = METHOD_LOGITECH_HID;
+ } else if (!strcmp(optarg, "dell")) {
+ method = METHOD_DELL;
+ usb_switch = usb_switch_dell;
+ } else {
+ usage("error: undefined switching method\n");
+ exit(1);
+ }
break;
case 'h':
usage(NULL);
default:
- exit(0);
+ exit(1);
}
}
- if (!quiet && (!dev.vendor || !dev.product || !method))
- usage("ERROR: Vendor ID, Product ID, and Switching Method must all be defined.\n");
+ if (!devpath || method == METHOD_UNDEF) {
+ usage("error: --devpath= and --method= must be defined\n");
+ exit(1);
+ }
- argc -= optind;
- argv += optind;
- optind = 0;
+ udev = udev_new();
+ if (udev == NULL)
+ goto exit;
+
+ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
+ udev_dev = udev_device_new_from_syspath(udev, syspath);
+ if (udev_dev == NULL) {
+ fprintf(stderr, "error: could not find '%s'\n", devpath);
+ goto exit;
+ }
- usb_init();
+ switch (method) {
+ case METHOD_CSR:
+ case METHOD_DELL: {
+ struct udev_device *dev;
+ struct usb_dev_handle *handle;
+ const char *type;
+
+ /* get the parent usb_device if needed */
+ dev = udev_dev;
+ type = udev_device_get_devtype(dev);
+ if (type == NULL || strcmp(type, "usb_device") != 0) {
+ dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device");
+ if (dev == NULL) {
+ fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath);
+ goto exit;
+ }
+ }
- if (!find_device(&dev)) {
- if (!quiet)
- fprintf(stderr, "Device %04x:%04x not found on USB bus.\n",
- dev.vendor, dev.product);
- exit(1);
+ handle = find_device(dev);
+ if (handle == NULL) {
+ fprintf(stderr, "error: unable to handle '%s'\n",
+ udev_device_get_syspath(dev));
+ goto exit;
+ }
+ err = usb_switch(handle, mode);
+ break;
}
+ case METHOD_LOGITECH_HID: {
+ const char *device;
- if (!quiet)
- printf("Attempting to switch device %04x:%04x to %s mode ",
- dev.vendor, dev.product, dev.mode ? "HID" : "HCI");
- fflush(stdout);
-
- if (method(&dev) < 0 && !quiet)
- printf("failed (%s)\n", strerror(errno));
- else if (!quiet)
- printf("was successful\n");
+ device = udev_device_get_devnode(udev_dev);
+ if (device == NULL) {
+ fprintf(stderr, "error: could not find hiddev device node\n");
+ goto exit;
+ }
+ err = hid_switch_logitech(device);
+ break;
+ }
+ default:
+ break;
+ }
- return errno;
+ if (err < 0)
+ fprintf(stderr, "error: switching device '%s' failed.\n",
+ udev_device_get_syspath(udev_dev));
+exit:
+ udev_device_unref(udev_dev);
+ udev_unref(udev);
+ return rc;
}

1
mirrors Normal file
View file

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

View file

@ -1,2 +1 @@
b9b6de70e26abb02c026296e9fbea25b pam_console_setowner-1.4.tgz
8a248b0c672e06b9c399c6e31471c922 udev-039.tar.gz
b3d3b5f88c7b81e7615700a04db685e1 udev-145.tar.bz2

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# start_udev
#
@ -24,19 +24,74 @@
sysfs_dir=/sys
export TZ=/etc/localtime
[ -d $sysfs_dir/class ] || exit 1
[ -r /proc/mounts ] || exit 1
[ -x /sbin/udev ] || exit 1
[ -x /sbin/udevd ] || exit 1
[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
udev_root=${udev_root-/dev}
if [ -f /dev/.in_sysinit ]; then
exec >/dev/console 2>/dev/console </dev/console
fi
. /etc/init.d/functions
. /etc/sysconfig/udev
prog=udev
bin=/sbin/udev
udevd=/sbin/udevd
MAKEDEV="/sbin/MAKEDEV"
# Check SELinux status
selinuxfs="$(fstab_decode_str `LC_ALL=C awk '/ selinuxfs / { print $2 }' /proc/mounts`)"
SELINUX_STATE=
if [ -n "$selinuxfs" ] && [ "`cat /proc/self/attr/current`" != "kernel" ]; then
if [ -r "$selinuxfs/enforce" ] ; then
SELINUX_STATE=`cat "$selinuxfs/enforce"`
else
# assume enforcing if you can't read it
SELINUX_STATE=1
fi
fi
touch_recursive() {
( cd $1;
for i in *; do
[[ -c "$i" || -b "$i" ]] && touch --no-create "$i"
[ -d "$i" ] && touch_recursive "$i"
done )
return 0
}
xargs_simple () {
if [ "$1" = "-n" ]; then
shift
MAXNR="$1"
shift
else
MAXNR=100
fi
NR=$MAXNR
ARGS=""
[ -z "$1" ] && set echo
while read line; do
if [ $NR -gt 0 ]; then
ARGS="$ARGS $line"
NR=$[$NR - 1]
else
"$@" $ARGS
NR=$MAXNR
ARGS="$line"
fi
done
if [ -n "$ARGS" ]; then
"$@" $ARGS
fi
}
make_extra_nodes () {
ln -snf /proc/self/fd $udev_root/fd
ln -snf /proc/self/fd/0 $udev_root/stdin
@ -44,56 +99,78 @@ make_extra_nodes () {
ln -snf /proc/self/fd/2 $udev_root/stderr
ln -snf /proc/kcore $udev_root/core
[ -d $udev_root/pts ] || (mkdir $udev_root/pts;chmod 0755 $udev_root/pts)
[ -d $udev_root/shm ] || (mkdir $udev_root/shm;chmod 0755 $udev_root/shm)
[ -d $udev_root/pts ] || mkdir -m 0755 $udev_root/pts
[ -d $udev_root/shm ] || mkdir -m 0755 $udev_root/shm
[ -d $udev_root/hugepages ] || mkdir -m 0755 $udev_root/hugepages
[ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
if [ -x $MAKEDEV ]; then
$MAKEDEV -x $(
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
echo cpu/$i/microcode;
done;
for i in 1 2 3 4 5 6; do echo tty$i;done;
for i in 0 1 2 3 4 5 6 7; do echo loop$i; done;
for i in 0 1 2 3; do echo lp$i; echo parport$i;done;
echo net/tun ppp console null zero;
);
[ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
cp -a /etc/udev/devices/* /dev/ >/dev/null 2>&1 || :
fi
}
USE_MD5="false"
[ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true"
# we cannot use /usr/bin/find here
find_d () {
where=$1
what=$2
found=""
for f in $where/*; do
if [ -d "$f" -a ! -L "$f" ]; then
if [ "$f" != "${f%%$what}" ];then
# make sure we are at the path end
# we have no dirname and basename
rest="${f#*$what}"
[ "${rest##*/}" = "$rest" ] && found="$found $f"
for i in 0 1 2 3 4 5 6 7; do
[ -b /dev/loop$i ] || /bin/mknod -m 0640 /dev/loop$i b 7 $i
/bin/chown root:disk /dev/loop$i
done
for i in 0 1 2 3; do
[ -c /dev/lp$i ] || /bin/mknod -m 0660 /dev/lp$i c 6 $i
/bin/chown root:lp /dev/lp$i
done
[ -d /dev/net ] || mkdir -p /dev/net
[ -c /dev/net/tun ] || /bin/mknod -m 0666 /dev/net/tun c 10 200
#/bin/chown root:root /dev/net/tun
[ -c /dev/ppp ] || /bin/mknod -m 0600 /dev/ppp c 108 0
#/bin/chown root:root /dev/ppp
[ -c /dev/fuse ] || /bin/mknod -m 0666 /dev/fuse c 10 229
#/bin/chown root:root /dev/fuse
if [ -x /sbin/restorecon ]; then
/sbin/restorecon -R /dev
fi
if [ -x "$MAKEDEV" ]; then
for i in /etc/udev/makedev.d/*.nodes; do
if [ -f "$i" ]; then
# use a little caching to speedup things
if [ "$USE_MD5" == "true" ]; then
# fix for MAKEDEV shell scripts
[ -d /dev/.udev/makedev.d ] || mkdir -p /dev/.udev/makedev.d
md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))-se$SELINUX_STATE
if [ -f "/var/lib/udev/makedev.d/${md5}.sh" ];then
md5file="/var/lib/udev/makedev.d/${md5}.sh"
else
md5file="/dev/.udev/makedev.d/${md5}.sh"
fi
if [ ! -f "$md5file" ]; then
( sed -e 's,#.*,,g' "$i" | \
xargs_simple -n 100 $MAKEDEV -x -a -S ) \
> "$md5file"
fi
. "$md5file" >$udev_root/null 2>&1
else
( sed -e 's,#.*,,g' "$i" | \
xargs_simple -n 100 $MAKEDEV -x )
fi
fi
found="$found $(find_d $f $what)"
fi
done
echo "$found"
}
done
fi
# we cannot use /usr/bin/find here
find_f () {
where=$1
what=$2
found=""
for f in $where/*; do
if [ -d "$f" -a ! -L "$f" ]; then
found="$found $(find_f $f $what)"
elif [ -e "$f" ]; then
[ "$f" != "${f%$what}" ] && found="$found $f"
for devdir in /etc/udev/devices /lib/udev/devices; do
[ -d "$devdir" ] || continue
pushd $devdir &> "$udev_root/null"
set *
if [ "$1" != "*" ]; then
#echo "Warning: $devdir is deprecated. Please use /etc/udev/makedev.d/."
cp -ar "$@" $udev_root/
pushd "$udev_root" &> "$udev_root/null"
[ -x /sbin/restorecon ] && /sbin/restorecon "$@"
popd &> "$udev_root/null"
fi
popd &> "$udev_root/null"
done
echo "$found"
}
kill_udevd() {
@ -103,83 +180,155 @@ kill_udevd() {
fi
}
# call hotplug with the scsi devices
scsi_replay () {
HOTPLUG=$(cat /proc/sys/kernel/hotplug)
[ -z "$HOTPLUG" ] && return 1
scsi_hosts=$(find_d /sys/devices host\*)
SEQNUM=1
for host in $scsi_hosts;do
[ -d $host ] || continue
devs=$(find_f $host type)
for dev in $devs;do
[ -f $dev ] || continue
export SEQNUM
DEVPATH=${dev%/type}
DEVPATH=${DEVPATH#/sys}
export DEVPATH
export ACTION=add
$HOTPLUG scsi_device
SEQNUM=$[$SEQNUM + 1]
$HOTPLUG scsi
SEQNUM=$[$SEQNUM + 1]
done
done
return 0
findalias () {
local n
for n in "$1"/* ; do
[ -h "$n" ] && continue
[ -d "$n" ] && { findalias "$n" ; continue; }
[ "${n##*/}" == "modalias" ] && echo $(cat $n)
done
}
ide_scan() {
if [ ! -d /proc/ide ]; then
return 1
fi
for i in /proc/ide/*/media; do
read media < "$i"
case "$media" in
disk)
module=ide-disk
;;
cdrom)
module=ide-cd
;;
tape)
module=ide-tape
;;
floppy)
module=ide-floppy
;;
*)
module=ide-generic
;;
esac
/sbin/modprobe $module
# returns OK if $1 contains $2
strstr() {
[ "${1#*$2*}" = "$1" ] && return 1
return 0
}
getval() {
what=$1
shift
for arg; do
if strstr "$arg" "$what="; then
val=${arg#${what}=*}
echo $val
return 0
fi
done
return 0
return 1
}
wait_for_queue() {
local timeout=${1:-0}
local ret=0
if [ $timeout -gt 0 ]; then
/sbin/udevadm settle --timeout=$timeout
else
/sbin/udevadm settle
fi
ret=$?
if [ $ret -ne 0 ]; then
echo -n "Wait timeout. Will continue in the background."
fi
return $ret;
}
export ACTION=add
export UDEV_NO_SLEEP=1
prog=udev
ret=0
STRING=$"Starting $prog: "
# propagate $udev_root from /sys
echo -n "$STRING "
grep -q "none ${udev_root%/} " /proc/mounts || {
mount -n -o mode=0755 -t tmpfs none "$udev_root"
echo -n "$STRING"
# mount the tmpfs on ${udev_root%/}, if not already done
LANG=C awk "\$2 == \"${udev_root%/}\" && ( \$3 == \"devtmpfs\" || \$3 == \"tmpfs\" ) { exit 1 }" /proc/mounts && {
if LANG=C fgrep -q "none ${udev_root%/}/pts " /proc/mounts; then
PTSDIR=$(mktemp -d)
mount --move $udev_root/pts "$PTSDIR"
fi
if LANG=C fgrep -q "none ${udev_root%/}/shm " /proc/mounts; then
SHMDIR=$(mktemp -d)
mount --move $udev_root/shm "$SHMDIR"
fi
# First try to mount a devtmpfs on $udev_root
mount -n -o mode=0755 -t devtmpfs none "$udev_root" 2>/dev/null \
|| mount -n -o mode=0755 -t tmpfs none "$udev_root"
mkdir -m 0755 $udev_root/pts
mkdir -m 0755 $udev_root/shm
if [ -n "$PTSDIR" ]; then
mount --move "$PTSDIR" $udev_root/pts
rmdir "$PTSDIR"
fi
if [ -n "$SHMDIR" ]; then
mount --move "$SHMDIR" $udev_root/shm
rmdir "$SHMDIR"
fi
ret=$[$ret + $?]
}
rm -f $udev_root/.udev.tdb
make_extra_nodes
kill_udevd >/dev/null 2>&1
scsi_replay >/dev/null 2>&1
ret=$[$ret + $?]
kill_udevd >/dev/null 2>&1
ide_scan >/dev/null 2>&1
/sbin/udevstart </dev/null >/dev/null 2>&1
ret=$[$ret + $?]
make_extra_nodes
cmdline=$(cat /proc/cmdline)
kill_udevd > "$udev_root/null" 2>&1
rm -fr $udev_root/.udev > "$udev_root/null" 2>&1
mkdir -p $udev_root/.udev > "$udev_root/null" 2>&1
UDEV_OPTS=""
if [ -f "/sys/class/tty/console/uevent" ]; then
# trigger the sorted events
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
if strstr "$cmdline" udevtrace; then
UDEV_OPTS="$UDEV_OPTS --debug-trace"
fi
if strstr "$cmdline" udevlog; then
UDEV_OPTS="$UDEV_OPTS --debug"
/sbin/udevd -d $UDEV_OPTS 2>$udev_root/.udev/udev.log
else
/sbin/udevd -d $UDEV_OPTS
fi
wait
ret=$[$ret + $?]
udevtimeout=$(getval udevtimeout $cmdline)
if strstr "$cmdline" udevdebug; then
/sbin/udevadm control --log-priority=debug
fi
if strstr "$cmdline" udevinfo; then
/sbin/udevadm control --log-priority=info
fi
if strstr "$cmdline" udevchilds; then
/sbin/udevadm control --max-childs=$(getval udevchilds $cmdline)
fi
/sbin/udevadm control --env=STARTUP=1
if strstr "$cmdline" modprobedebug; then
/sbin/udevadm control --env=MODPROBE_OPTIONS="-s -v -q"
echo
findalias /sys | while read modules ; do
if [ -n "$modules" ]; then
echo "Loading modules for $modules in 5 seconds"
sleep 5
/sbin/modprobe -a -v -q $modules
wait_for_queue $udevtimeout
fi
done
echo "Triggering Rest"
fi
/sbin/udevadm trigger
ret=$[$ret + $?]
wait_for_queue $udevtimeout
ret=$[$ret + $?]
wait
ret=$[$ret + $?]
/sbin/udevadm control --env=STARTUP=
# touch all device files for timezone glitches
# "find" is in /usr/bin and might not be available
if [ -f /etc/sysconfig/clock ]; then
. /etc/sysconfig/clock
[[ "$UTC" == "false" || "$UTC" == "no" ]] \
&& touch_recursive /dev > "$udev_root/null" 2>&1
fi
else
echo -n " kernel too old for this udev version "
/sbin/udevd -d $UDEV_OPTS
ret=10
fi
[ $ret -eq 0 ] && success $"$STRING" || failure $"$STRING"
echo
exit 0

View file

@ -0,0 +1,8 @@
--- udev-141/rules/redhat/40-redhat.rules 2008-10-16 11:03:43.000000000 -0500
+++ udev-141.cpu/rules/redhat/40-redhat.rules 2009-05-20 11:23:12.000000000 -0500
@@ -25,3 +25,5 @@
KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty"
KERNEL=="event*", ATTRS{idVendor}=="03f0", ATTRS{interface}=="Virtual Mouse", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="input/hp_ilo_mouse"
+
+ACTION=="add", KERNEL=="cpu[0-9]*", RUN+="/bin/bash -c 'echo 1 > /sys/devices/system/cpu/%k/online'"

View file

@ -0,0 +1,298 @@
diff -urN udev-145-orig/extras/cdrom_id/60-cdrom_id.rules udev-145/extras/cdrom_id/60-cdrom_id.rules
--- udev-145-orig/extras/cdrom_id/60-cdrom_id.rules 2010-09-21 12:05:03.025750002 +0200
+++ udev-145/extras/cdrom_id/60-cdrom_id.rules 2010-06-11 10:52:56.000000000 +0200
@@ -1,7 +1,6 @@
# do not edit this file, it will be overwritten on update
-# import optical drive properties
-ACTION!="add|change", GOTO="cdrom_end"
+ACTION=="remove", GOTO="cdrom_end"
SUBSYSTEM!="block", GOTO="cdrom_end"
KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
Binary files udev-145-orig/extras/cdrom_id/cdrom_id and udev-145/extras/cdrom_id/cdrom_id differ
diff -urN udev-145-orig/extras/cdrom_id/cdrom_id.c udev-145/extras/cdrom_id/cdrom_id.c
--- udev-145-orig/extras/cdrom_id/cdrom_id.c 2010-09-21 12:05:03.024750002 +0200
+++ udev-145/extras/cdrom_id/cdrom_id.c 2010-08-31 10:35:41.000000000 +0200
@@ -85,6 +85,8 @@
static unsigned int cd_media_dvd_rom = 0;
static unsigned int cd_media_dvd_r = 0;
static unsigned int cd_media_dvd_rw = 0;
+static unsigned int cd_media_dvd_rw_ro = 0; /* restricted overwrite mode */
+static unsigned int cd_media_dvd_rw_seq = 0; /* sequential mode */
static unsigned int cd_media_dvd_ram = 0;
static unsigned int cd_media_dvd_plus_r = 0;
static unsigned int cd_media_dvd_plus_rw = 0;
@@ -200,27 +202,27 @@
static int cd_capability_compat(struct udev *udev, int fd)
{
- int capabilty;
+ int capability;
- capabilty = ioctl(fd, CDROM_GET_CAPABILITY, NULL);
- if (capabilty < 0) {
+ capability = ioctl(fd, CDROM_GET_CAPABILITY, NULL);
+ if (capability < 0) {
info(udev, "CDROM_GET_CAPABILITY failed\n");
return -1;
}
- if (capabilty & CDC_CD_R)
+ if (capability & CDC_CD_R)
cd_cd_r = 1;
- if (capabilty & CDC_CD_RW)
+ if (capability & CDC_CD_RW)
cd_cd_rw = 1;
- if (capabilty & CDC_DVD)
+ if (capability & CDC_DVD)
cd_dvd_rom = 1;
- if (capabilty & CDC_DVD_R)
+ if (capability & CDC_DVD_R)
cd_dvd_r = 1;
- if (capabilty & CDC_DVD_RAM)
+ if (capability & CDC_DVD_RAM)
cd_dvd_ram = 1;
- if (capabilty & CDC_MRW)
+ if (capability & CDC_MRW)
cd_mrw = 1;
- if (capabilty & CDC_MRW_W)
+ if (capability & CDC_MRW_W)
cd_mrw_w = 1;
return 0;
}
@@ -348,6 +350,39 @@
return 0;
}
+static int cd_profiles_old_mmc(struct udev *udev, int fd)
+{
+ struct scsi_cmd sc;
+ int err;
+
+ unsigned char header[32];
+
+ scsi_cmd_init(udev, &sc, header, sizeof(header));
+ scsi_cmd_set(udev, &sc, 0, 0x51);
+ scsi_cmd_set(udev, &sc, 8, sizeof(header));
+ scsi_cmd_set(udev, &sc, 9, 0);
+ err = scsi_cmd_run(udev, &sc, fd, header, sizeof(header));
+ if ((err != 0)) {
+ info_scsi_cmd_err(udev, "READ DISC INFORMATION", err);
+ info(udev, "no current profile, assuming no media\n");
+ return -1;
+ };
+
+ cd_media = 1;
+
+ if (header[2] & 16) {
+ cd_media_cd_rw = 1;
+ info(udev, "profile 0x0a media_cd_rw\n");
+ } else if ((header[2] & 3) < 2 && cd_cd_r) {
+ cd_media_cd_r = 1;
+ info(udev, "profile 0x09 media_cd_r\n");
+ } else {
+ cd_media_cd_rom = 1;
+ info(udev, "profile 0x08 media_cd_rom\n");
+ }
+ return 0;
+}
+
static int cd_profiles(struct udev *udev, int fd)
{
struct scsi_cmd sc;
@@ -365,6 +400,12 @@
err = scsi_cmd_run(udev, &sc, fd, features, sizeof(features));
if ((err != 0)) {
info_scsi_cmd_err(udev, "GET CONFIGURATION", err);
+ /* handle pre-MMC2 drives which do not support GET CONFIGURATION */
+ if (SK(err) == 0x5 && ASC(err) == 0x20) {
+ info(udev, "drive is pre-MMC2 and does not support 46h get configuration command\n");
+ info(udev, "trying to work around the problem\n");
+ return cd_profiles_old_mmc(udev, fd);
+ }
return -1;
}
@@ -440,10 +481,16 @@
cd_media_dvd_ram = 1;
break;
case 0x13:
+ info(udev, "profile 0x%02x media_dvd_rw_ro\n", cur_profile);
+ cd_media = 1;
+ cd_media_dvd_rw = 1;
+ cd_media_dvd_rw_ro = 1;
+ break;
case 0x14:
- info(udev, "profile 0x%02x media_dvd_rw\n", cur_profile);
+ info(udev, "profile 0x%02x media_dvd_rw_seq\n", cur_profile);
cd_media = 1;
cd_media_dvd_rw = 1;
+ cd_media_dvd_rw_seq = 1;
break;
case 0x1B:
info(udev, "profile 0x%02x media_dvd_plus_r\n", cur_profile);
@@ -527,12 +574,126 @@
cd_media = 1;
info(udev, "disk type %02x\n", header[8]);
+ info(udev, "hardware reported media status: %s\n", media_status[header[2] & 3]);
/* exclude plain CDROM, some fake cdroms return 0 for "blank" media here */
if (!cd_media_cd_rom)
cd_media_state = media_status[header[2] & 3];
- if ((header[2] & 3) != 2)
+ /* fresh DVD-RW in restricted overwite mode reports itself as
+ * "appendable"; change it to "blank" to make it consistent with what
+ * gets reported after blanking, and what userspace expects */
+ if (cd_media_dvd_rw_ro && (header[2] & 3) == 1)
+ cd_media_state = media_status[0];
+
+ /* DVD+RW discs (and DVD-RW in restricted mode) once formatted are
+ * always "complete", DVD-RAM are "other" or "complete" if the disc is
+ * write protected; we need to check the contents if it is blank */
+ if ((cd_media_dvd_rw_ro || cd_media_dvd_plus_rw || cd_media_dvd_plus_rw_dl || cd_media_dvd_ram) && (header[2] & 3) > 1) {
+ unsigned char buffer[32 * 2048];
+ unsigned char result, len;
+ int block, offset;
+
+ if (cd_media_dvd_ram) {
+ /* a write protected dvd-ram may report "complete" status */
+
+ unsigned char dvdstruct[8];
+ unsigned char format[12];
+
+ scsi_cmd_init(udev, &sc, dvdstruct, sizeof(dvdstruct));
+ scsi_cmd_set(udev, &sc, 0, 0xAD);
+ scsi_cmd_set(udev, &sc, 7, 0xC0);
+ scsi_cmd_set(udev, &sc, 9, sizeof(dvdstruct));
+ scsi_cmd_set(udev, &sc, 11, 0);
+ err = scsi_cmd_run(udev, &sc, fd, dvdstruct, sizeof(dvdstruct));
+ if ((err != 0)) {
+ info_scsi_cmd_err(udev, "READ DVD STRUCTURE", err);
+ return -1;
+ }
+ if (dvdstruct[4] & 0x02) {
+ cd_media_state = media_status[2];
+ info(udev, "write-protected DVD-RAM media inserted\n");
+ goto determined;
+ }
+
+ /* let's make sure we don't try to read unformatted media */
+ scsi_cmd_init(udev, &sc, format, sizeof(format));
+ scsi_cmd_set(udev, &sc, 0, 0x23);
+ scsi_cmd_set(udev, &sc, 8, sizeof(format));
+ scsi_cmd_set(udev, &sc, 9, 0);
+ err = scsi_cmd_run(udev, &sc, fd, format, sizeof(format));
+ if ((err != 0)) {
+ info_scsi_cmd_err(udev, "READ DVD FORMAT CAPACITIES", err);
+ return -1;
+ }
+
+ len = format[3];
+ if (len & 7 || len < 16) {
+ info(udev, "invalid format capacities length\n");
+ return -1;
+ }
+
+ switch(format[8] & 3) {
+ case 1:
+ info(udev, "unformatted DVD-RAM media inserted\n");
+ /* This means that last format was interrupted
+ * or failed, blank dvd-ram discs are factory
+ * formatted. Take no action here as it takes
+ * quite a while to reformat a dvd-ram and it's
+ * not automatically started */
+ goto determined;
+
+ case 2:
+ info(udev, "formatted DVD-RAM media inserted\n");
+ break;
+
+ case 3:
+ cd_media = 0; //return no media
+ info(udev, "format capacities returned no media\n");
+ return -1;
+ }
+ }
+
+ /* Take a closer look at formatted media (unformatted DVD+RW
+ * has "blank" status", DVD-RAM was examined earlier) and check
+ * for ISO and UDF PVDs or a fs superblock presence and do it
+ * in one ioctl (we need just sectors 0 and 16) */
+ scsi_cmd_init(udev, &sc, buffer, sizeof(buffer));
+ scsi_cmd_set(udev, &sc, 0, 0x28);
+ scsi_cmd_set(udev, &sc, 5, 0);
+ scsi_cmd_set(udev, &sc, 8, 32);
+ scsi_cmd_set(udev, &sc, 9, 0);
+ err = scsi_cmd_run(udev, &sc, fd, buffer, sizeof(buffer));
+ if ((err != 0)) {
+ info_scsi_cmd_err(udev, "READ FIRST 32 BLOCKS", err);
+ return -1;
+ }
+
+ /* if any non-zero data is found in sector 16 (iso and udf) or
+ * eventually 0 (fat32 boot sector, ext2 superblock, etc), disc
+ * is assumed non-blank */
+ result = 0;
+
+ for (block = 32768; block >= 0 && !result; block -= 32768) {
+ offset = block;
+ while (offset < (block + 2048) && !result) {
+ result = buffer [offset];
+ offset++;
+ }
+ }
+
+ if (!result) {
+ cd_media_state = media_status[0];
+ info(udev, "no data in blocks 0 or 16, assuming blank\n");
+ } else {
+ info(udev, "data in blocks 0 or 16, assuming complete\n");
+ }
+ }
+
+determined:
+ /* "other" is e. g. DVD-RAM, can't append sessions there; DVDs in
+ * restricted overwrite mode can never append, only in sequential mode */
+ if ((header[2] & 3) < 2 && !cd_media_dvd_rw_ro)
cd_media_session_next = header[10] << 8 | header[5];
cd_media_session_count = header[9] << 8 | header[4];
cd_media_track_count = header[11] << 8 | header[6];
@@ -710,13 +871,11 @@
if (cd_profiles(udev, fd) < 0)
goto print;
- /* get writable media state */
- if (cd_media_info(udev, fd) < 0)
- goto print;
-
/* get session/track info */
- if (cd_media_toc(udev, fd) < 0)
- goto print;
+ cd_media_toc(udev, fd);
+
+ /* get writable media state */
+ cd_media_info(udev, fd);
print:
printf("ID_CDROM=1\n");
@@ -810,14 +969,14 @@
printf("ID_CDROM_MEDIA_SESSION_NEXT=%d\n", cd_media_session_next);
if (cd_media_session_count > 0)
printf("ID_CDROM_MEDIA_SESSION_COUNT=%d\n", cd_media_session_count);
+ if (cd_media_session_count > 1 && cd_media_session_last_offset > 0)
+ printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset);
if (cd_media_track_count > 0)
printf("ID_CDROM_MEDIA_TRACK_COUNT=%d\n", cd_media_track_count);
if (cd_media_track_count_audio > 0)
printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%d\n", cd_media_track_count_audio);
if (cd_media_track_count_data > 0)
printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%d\n", cd_media_track_count_data);
- if (cd_media_session_last_offset > 0)
- printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset);
exit:
if (fd >= 0)
close(fd);

14
udev-145-floppy.patch Normal file
View file

@ -0,0 +1,14 @@
diff -up udev-145/rules/rules.d/50-udev-default.rules.floppy udev-145/rules/rules.d/50-udev-default.rules
--- udev-145/rules/rules.d/50-udev-default.rules.floppy 2010-09-21 12:16:36.562750009 +0200
+++ udev-145/rules/rules.d/50-udev-default.rules 2010-09-21 12:17:48.201750065 +0200
@@ -69,7 +69,9 @@ SUBSYSTEM=="block", GROUP="disk"
# floppy
KERNEL=="fd[0-9]", GROUP="floppy"
-KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k"
+KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", ENV{CMOS_TYPE}="$attr{cmos}", \
+ RUN+="create_floppy_devices -c -t $env{CMOS_TYPE} -m %M -M 0640 -G floppy $root/%k"
+
KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions"
# cdrom

View file

@ -0,0 +1,638 @@
diff -upr udev-145.old/extras/hid2hci/70-hid2hci.rules udev-145/extras/hid2hci/70-hid2hci.rules
--- udev-145.old/extras/hid2hci/70-hid2hci.rules 2009-06-28 01:07:53.000000000 +0100
+++ udev-145/extras/hid2hci/70-hid2hci.rules 2009-11-05 00:00:29.000000000 +0000
@@ -1,25 +1,28 @@
# do not edit this file, it will be overwritten on update
-ACTION!="add", GOTO="hid2hci_end"
+ACTION!="add|change", GOTO="hid2hci_end"
SUBSYSTEM!="usb", GOTO="hid2hci_end"
-# Variety of Dell Bluetooth devices - it looks like a bit of an odd rule,
-# because it is matching on a mouse device that is self powered, but that
-# is where a HID report needs to be sent to switch modes.
-#
+# Variety of Dell Bluetooth devices - match on a mouse device that is
+# self powered and where a HID report needs to be sent to switch modes
# Known supported devices: 413c:8154, 413c:8158, 413c:8162
-ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
- RUN+="hid2hci --method dell -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProtocol}=="02", \
+ ATTRS{bDeviceClass}=="00", ATTRS{idVendor}=="413c", ATTRS{bmAttributes}=="e0", \
+ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1"
+
+# Logitech devices (hidraw)
+KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \
+ RUN+="hid2hci --method=logitech-hid --devpath=%p"
ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"
-# Logitech devices
-ATTR{idVendor}=="046d", ATTR{idProduct}=="c70[345abce]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="046d", ATTR{idProduct}=="c71[34bc]", RUN+="hid2hci --method logitech -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-
-# CSR devices (in HID mode)
-ATTR{idVendor}=="0a12", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="0458", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
-ATTR{idVendor}=="05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method csr -v $attr{idVendor} -p $attr{idProduct} --mode hci"
+# When a Dell device recovers from S3, the mouse child needs to be repoked
+# Unfortunately the only event seen is the BT device disappearing, so the mouse
+# device needs to be chased down on the USB bus.
+ATTR{bDeviceClass}=="e0", ATTR{bDeviceSubClass}=="01", ATTR{bDeviceProtocol}=="01", ATTR{idVendor}=="413c", \
+ ENV{REMOVE_CMD}="/sbin/udevadm trigger --action=change --subsystem-match=usb --property-match=HID2HCI_SWITCH=1"
+
+# CSR devices
+ATTR{idVendor}=="0a12|0458|05ac", ATTR{idProduct}=="1000", RUN+="hid2hci --method=csr --devpath=%p"
LABEL="hid2hci_end"
diff -upr udev-145.old/extras/hid2hci/hid2hci.c udev-145/extras/hid2hci/hid2hci.c
--- udev-145.old/extras/hid2hci/hid2hci.c 2009-06-13 01:55:10.000000000 +0100
+++ udev-145/extras/hid2hci/hid2hci.c 2009-11-05 00:00:24.000000000 +0000
@@ -1,31 +1,26 @@
/*
+ * hid2hci : switch the radio on devices that support
+ * it from HID to HCI and back
*
- * hid2hci : a tool for switching the radio on devices that support
- * it from HID to HCI and back
+ * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
+ * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
*
- * Copyright (C) 2003-2009 Marcel Holtmann <marcel@holtmann.org>
- * Copyright (C) 2008-2009 Mario Limonciello <mario_limonciello@dell.com>
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
@@ -33,79 +28,24 @@
#include <string.h>
#include <getopt.h>
#include <sys/ioctl.h>
-
+#include <linux/hiddev.h>
#include <usb.h>
-#ifdef NEED_USB_GET_BUSSES
-static inline struct usb_bus *usb_get_busses(void)
-{
- return usb_busses;
-}
-#endif
-
-#ifndef USB_DIR_OUT
-#define USB_DIR_OUT 0x00
-#endif
-
-static char devpath[PATH_MAX + 1] = "/dev";
-
-struct hiddev_devinfo {
- unsigned int bustype;
- unsigned int busnum;
- unsigned int devnum;
- unsigned int ifnum;
- short vendor;
- short product;
- short version;
- unsigned num_applications;
-};
-
-struct hiddev_report_info {
- unsigned report_type;
- unsigned report_id;
- unsigned num_fields;
-};
-
-typedef __signed__ int __s32;
+#include "libudev.h"
+#include "libudev-private.h"
-struct hiddev_usage_ref {
- unsigned report_type;
- unsigned report_id;
- unsigned field_index;
- unsigned usage_index;
- unsigned usage_code;
- __s32 value;
+enum mode {
+ HCI = 0,
+ HID = 1,
};
-#define HIDIOCGDEVINFO _IOR('H', 0x03, struct hiddev_devinfo)
-#define HIDIOCINITREPORT _IO('H', 0x05)
-#define HIDIOCSREPORT _IOW('H', 0x08, struct hiddev_report_info)
-#define HIDIOCSUSAGE _IOW('H', 0x0C, struct hiddev_usage_ref)
-
-#define HID_REPORT_TYPE_OUTPUT 2
-
-#define HCI 0
-#define HID 1
-
-struct device_info {
- struct usb_device *dev;
- int mode;
- uint16_t vendor;
- uint16_t product;
-};
-
-static int switch_csr(struct device_info *devinfo)
+static int usb_switch_csr(struct usb_dev_handle *dev, enum mode mode)
{
- struct usb_dev_handle *udev;
int err;
- udev = usb_open(devinfo->dev);
- if (!udev)
- return -errno;
-
- err = usb_control_msg(udev, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0, devinfo->mode, 0, NULL, 0, 10000);
-
+ err = usb_control_msg(dev,
+ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, mode, 0, NULL, 0, 10000);
if (err == 0) {
err = -1;
errno = EALREADY;
@@ -113,13 +53,10 @@ static int switch_csr(struct device_info
if (errno == ETIMEDOUT)
err = 0;
}
-
- usb_close(udev);
-
return err;
}
-static int send_report(int fd, const char *buf, size_t size)
+static int hid_logitech_send_report(int fd, const char *buf, size_t size)
{
struct hiddev_report_info rinfo;
struct hiddev_usage_ref uref;
@@ -148,72 +85,42 @@ static int send_report(int fd, const cha
return err;
}
-static int switch_logitech(struct device_info *devinfo)
+static int hid_switch_logitech(const char *filename)
{
- char devname[PATH_MAX + 1];
- int i, fd, err = -1;
-
- for (i = 0; i < 16; i++) {
- struct hiddev_devinfo dinfo;
- char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
- char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
- char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
-
- sprintf(devname, "%s/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0) {
- sprintf(devname, "%s/usb/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0) {
- sprintf(devname, "%s/usb/hid/hiddev%d", devpath, i);
- fd = open(devname, O_RDWR);
- if (fd < 0)
- continue;
- }
- }
-
- memset(&dinfo, 0, sizeof(dinfo));
- err = ioctl(fd, HIDIOCGDEVINFO, &dinfo);
- if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) ||
- (int) dinfo.devnum != atoi(devinfo->dev->filename)) {
- close(fd);
- continue;
- }
-
- err = ioctl(fd, HIDIOCINITREPORT, 0);
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep1, sizeof(rep1));
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep2, sizeof(rep2));
- if (err < 0) {
- close(fd);
- break;
- }
-
- err = send_report(fd, rep3, sizeof(rep3));
- close(fd);
- break;
- }
-
+ char rep1[] = { 0xff, 0x80, 0x80, 0x01, 0x00, 0x00 };
+ char rep2[] = { 0xff, 0x80, 0x00, 0x00, 0x30, 0x00 };
+ char rep3[] = { 0xff, 0x81, 0x80, 0x00, 0x00, 0x00 };
+ int fd;
+ int err = -1;
+
+ fd = open(filename, O_RDWR);
+ if (fd < 0)
+ return err;
+
+ err = ioctl(fd, HIDIOCINITREPORT, 0);
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep1, sizeof(rep1));
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep2, sizeof(rep2));
+ if (err < 0)
+ goto out;
+
+ err = hid_logitech_send_report(fd, rep3, sizeof(rep3));
+out:
+ close(fd);
return err;
}
-static int switch_dell(struct device_info *devinfo)
+static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode)
{
char report[] = { 0x7f, 0x00, 0x00, 0x00 };
-
- struct usb_dev_handle *handle;
int err;
- switch (devinfo->mode) {
+ switch (mode) {
case HCI:
report[1] = 0x13;
break;
@@ -222,22 +129,16 @@ static int switch_dell(struct device_inf
break;
}
- handle = usb_open(devinfo->dev);
- if (!handle)
- return -EIO;
-
/* Don't need to check return, as might not be in use */
- usb_detach_kernel_driver_np(handle, 0);
+ usb_detach_kernel_driver_np(dev, 0);
- if (usb_claim_interface(handle, 0) < 0) {
- usb_close(handle);
+ if (usb_claim_interface(dev, 0) < 0)
return -EIO;
- }
- err = usb_control_msg(handle,
- USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
+ err = usb_control_msg(dev,
+ USB_ENDPOINT_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
USB_REQ_SET_CONFIGURATION, 0x7f | (0x03 << 8), 0,
- report, sizeof(report), 5000);
+ report, sizeof(report), 5000);
if (err == 0) {
err = -1;
@@ -246,131 +147,203 @@ static int switch_dell(struct device_inf
if (errno == ETIMEDOUT)
err = 0;
}
-
- usb_close(handle);
-
return err;
}
-static int find_device(struct device_info* devinfo)
+/*
+ * The braindead libusb needs to scan and open all devices, just to
+ * to find the device we already have. This needs to be fixed in libusb
+ * or it will be ripped out and we carry our own code.
+ */
+static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev)
{
struct usb_bus *bus;
- struct usb_device *dev;
+ const char *str;
+ int busnum;
+ int devnum;
+
+ str = udev_device_get_sysattr_value(usb_dev, "busnum");
+ if (str == NULL)
+ return NULL;
+ busnum = strtol(str, NULL, 0);
+
+ str = udev_device_get_sysattr_value(usb_dev, "devnum");
+ if (str == NULL)
+ return NULL;
+ devnum = strtol(str, NULL, 0);
+ usb_init();
usb_find_busses();
usb_find_devices();
- for (bus = usb_get_busses(); bus; bus = bus->next)
+ for (bus = usb_get_busses(); bus; bus = bus->next) {
+ struct usb_device *dev;
+
+ if (strtol(bus->dirname, NULL, 10) != busnum)
+ continue;
+
for (dev = bus->devices; dev; dev = dev->next) {
- if (dev->descriptor.idVendor == devinfo->vendor &&
- dev->descriptor.idProduct == devinfo->product) {
- devinfo->dev=dev;
- return 1;
- }
+ if (dev->devnum == devnum)
+ return dev;
}
- return 0;
+ }
+
+ return NULL;
+}
+
+static struct usb_dev_handle *find_device(struct udev_device *udev_dev)
+{
+ struct usb_device *dev;
+
+ dev = usb_device_open_from_udev(udev_dev);
+ if (dev == NULL)
+ return NULL;
+ return usb_open(dev);
}
-static void usage(char* error)
+static void usage(const char *error)
{
if (error)
fprintf(stderr,"\n%s\n", error);
else
printf("hid2hci - Bluetooth HID to HCI mode switching utility\n\n");
- printf("Usage:\n"
- "\thid2hci [options]\n"
- "\n");
-
- printf("Options:\n"
- "\t-h, --help Display help\n"
- "\t-q, --quiet Don't display any messages\n"
- "\t-r, --mode= Mode to switch to [hid, hci]\n"
- "\t-v, --vendor= Vendor ID to act upon\n"
- "\t-p, --product= Product ID to act upon\n"
- "\t-m, --method= Method to use to switch [csr, logitech, dell]\n"
- "\n");
- if (error)
- exit(1);
+ printf("Usage: hid2hci [options]\n"
+ " --mode= mode to switch to [hid|hci] (default hci)\n"
+ " --devpath= sys device path\n"
+ " --method= method to use to switch [csr|logitech-hid|dell]\n"
+ " --help\n\n");
}
-static const struct option main_options[] = {
- { "help", no_argument, 0, 'h' },
- { "quiet", no_argument, 0, 'q' },
- { "mode", required_argument, 0, 'r' },
- { "vendor", required_argument, 0, 'v' },
- { "product", required_argument, 0, 'p' },
- { "method", required_argument, 0, 'm' },
- { 0, 0, 0, 0 }
-};
-
int main(int argc, char *argv[])
{
- struct device_info dev = { NULL, HCI, 0, 0 };
- int opt, quiet = 0;
- int (*method)(struct device_info *dev) = NULL;
-
- while ((opt = getopt_long(argc, argv, "+r:v:p:m:qh", main_options, NULL)) != -1) {
- switch (opt) {
- case 'r':
- if (optarg && !strcmp(optarg, "hid"))
- dev.mode = HID;
- else if (optarg && !strcmp(optarg, "hci"))
- dev.mode = HCI;
- else
- usage("ERROR: Undefined radio mode\n");
+ static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
+ { "mode", required_argument, NULL, 'm' },
+ { "devpath", required_argument, NULL, 'p' },
+ { "method", required_argument, NULL, 'M' },
+ { }
+ };
+ enum method {
+ METHOD_UNDEF,
+ METHOD_CSR,
+ METHOD_LOGITECH_HID,
+ METHOD_DELL,
+ } method = METHOD_UNDEF;
+ struct udev *udev;
+ struct udev_device *udev_dev = NULL;
+ char syspath[UTIL_PATH_SIZE];
+ int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL;
+ enum mode mode = HCI;
+ const char *devpath = NULL;
+ int err = -1;
+ int rc = 1;
+
+ for (;;) {
+ int option;
+
+ option = getopt_long(argc, argv, "m:p:M:qh", options, NULL);
+ if (option == -1)
break;
- case 'v':
- sscanf(optarg, "%4hx", &dev.vendor);
+
+ switch (option) {
+ case 'm':
+ if (!strcmp(optarg, "hid")) {
+ mode = HID;
+ } else if (!strcmp(optarg, "hci")) {
+ mode = HCI;
+ } else {
+ usage("error: undefined radio mode\n");
+ exit(1);
+ }
break;
case 'p':
- sscanf(optarg, "%4hx", &dev.product);
- break;
- case 'm':
- if (optarg && !strcmp(optarg, "csr"))
- method = switch_csr;
- else if (optarg && !strcmp(optarg, "logitech"))
- method = switch_logitech;
- else if (optarg && !strcmp(optarg, "dell"))
- method = switch_dell;
- else
- usage("ERROR: Undefined switching method\n");
+ devpath = optarg;
break;
- case 'q':
- quiet = 1;
+ case 'M':
+ if (!strcmp(optarg, "csr")) {
+ method = METHOD_CSR;
+ usb_switch = usb_switch_csr;
+ } else if (!strcmp(optarg, "logitech-hid")) {
+ method = METHOD_LOGITECH_HID;
+ } else if (!strcmp(optarg, "dell")) {
+ method = METHOD_DELL;
+ usb_switch = usb_switch_dell;
+ } else {
+ usage("error: undefined switching method\n");
+ exit(1);
+ }
break;
case 'h':
usage(NULL);
default:
- exit(0);
+ exit(1);
}
}
- if (!quiet && (!dev.vendor || !dev.product || !method))
- usage("ERROR: Vendor ID, Product ID, and Switching Method must all be defined.\n");
+ if (!devpath || method == METHOD_UNDEF) {
+ usage("error: --devpath= and --method= must be defined\n");
+ exit(1);
+ }
- argc -= optind;
- argv += optind;
- optind = 0;
+ udev = udev_new();
+ if (udev == NULL)
+ goto exit;
+
+ util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
+ udev_dev = udev_device_new_from_syspath(udev, syspath);
+ if (udev_dev == NULL) {
+ fprintf(stderr, "error: could not find '%s'\n", devpath);
+ goto exit;
+ }
- usb_init();
+ switch (method) {
+ case METHOD_CSR:
+ case METHOD_DELL: {
+ struct udev_device *dev;
+ struct usb_dev_handle *handle;
+ const char *type;
+
+ /* get the parent usb_device if needed */
+ dev = udev_dev;
+ type = udev_device_get_devtype(dev);
+ if (type == NULL || strcmp(type, "usb_device") != 0) {
+ dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device");
+ if (dev == NULL) {
+ fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath);
+ goto exit;
+ }
+ }
- if (!find_device(&dev)) {
- if (!quiet)
- fprintf(stderr, "Device %04x:%04x not found on USB bus.\n",
- dev.vendor, dev.product);
- exit(1);
+ handle = find_device(dev);
+ if (handle == NULL) {
+ fprintf(stderr, "error: unable to handle '%s'\n",
+ udev_device_get_syspath(dev));
+ goto exit;
+ }
+ err = usb_switch(handle, mode);
+ break;
}
+ case METHOD_LOGITECH_HID: {
+ const char *device;
- if (!quiet)
- printf("Attempting to switch device %04x:%04x to %s mode ",
- dev.vendor, dev.product, dev.mode ? "HID" : "HCI");
- fflush(stdout);
-
- if (method(&dev) < 0 && !quiet)
- printf("failed (%s)\n", strerror(errno));
- else if (!quiet)
- printf("was successful\n");
+ device = udev_device_get_devnode(udev_dev);
+ if (device == NULL) {
+ fprintf(stderr, "error: could not find hiddev device node\n");
+ goto exit;
+ }
+ err = hid_switch_logitech(device);
+ break;
+ }
+ default:
+ break;
+ }
- return errno;
+ if (err < 0)
+ fprintf(stderr, "error: switching device '%s' failed.\n",
+ udev_device_get_syspath(udev_dev));
+exit:
+ udev_device_unref(udev_dev);
+ udev_unref(udev);
+ return rc;
}
--- udev-145.old/extras/hid2hci/Makefile.am 2009-06-16 23:49:02.000000000 +0100
+++ udev-145/extras/hid2hci/Makefile.am 2009-11-05 00:10:10.000000000 +0000
@@ -10,4 +10,4 @@ hid2hci_SOURCES = \
hid2hci.c
hid2hci_LDADD = \
- @LIBUSB_LIBS@
+ @LIBUSB_LIBS@ $(top_builddir)/libudev/libudev.la
--- udev-145.old/libudev/exported_symbols 2009-05-21 21:16:39.000000000 +0100
+++ udev-145/libudev/exported_symbols 2009-11-05 00:15:08.000000000 +0000
@@ -71,3 +71,4 @@ udev_queue_get_seqnum_is_finished
udev_queue_get_seqnum_sequence_is_finished
udev_queue_get_queued_list_entry
udev_queue_get_failed_list_entry
+util_strscpyl

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,18 @@
diff -up udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules.modesw udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules
--- udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules.modesw 2009-06-10 20:31:14.000000000 +0200
+++ udev-145/extras/modem-modeswitch/61-option-modem-modeswitch.rules 2010-03-19 10:39:13.000000000 +0100
@@ -5,7 +5,6 @@ SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_d
GOTO="option_zerocd_end"
LABEL="option_zerocd_disable"
-ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="1000", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6711", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6731", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
@@ -34,5 +33,6 @@ ATTRS{idVendor}=="0af0", ATTRS{idProduct
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7501", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
+ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="d055", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
LABEL="option_zerocd_end"

20
udev-145-rename.patch Normal file
View file

@ -0,0 +1,20 @@
commit 6068553195f43a2fd7987c48178de23b63a09f15
Author: Harald Hoyer <harald@redhat.com>
Date: Fri Sep 18 13:14:30 2009 +0200
rename interfaces to <iface>_rename if rename fails
diff --git a/udev/udev-event.c b/udev/udev-event.c
index 701c061..d5b4d09 100644
--- a/udev/udev-event.c
+++ b/udev/udev-event.c
@@ -492,8 +492,7 @@ static int rename_netif(struct udev_event *event)
}
/* free our own name, another process may wait for us */
- util_strscpy(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev));
- util_strscpy(ifr.ifr_newname, IFNAMSIZ, "_rename");
+ util_strscpyl(ifr.ifr_newname, IFNAMSIZ, udev_device_get_sysname(dev), "_rename", NULL);
err = ioctl(sk, SIOCSIFNAME, &ifr);
if (err != 0) {
err(event->udev, "error changing netif name %s to %s: %m\n",

View file

@ -0,0 +1,14 @@
--- udev-145/rules/rules.d/60-persistent-storage.rules.orig 2010-09-21 10:56:28.992750001 +0200
+++ udev-145/rules/rules.d/60-persistent-storage.rules 2010-09-21 11:36:11.395750000 +0200
@@ -61,9 +61,9 @@
ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
# probe filesystem metadata of optical drives which have a media inserted
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
-KERNEL=="sr*", ENV{ID_CDROM_MEDIA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
+KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
# probe filesystem metadata of disks
KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"

34
udev-147-virtio.patch Normal file
View file

@ -0,0 +1,34 @@
commit 25728ea1ad0c128ae504801abf1f6bfaab608d93
Author: Amit Shah <amit.shah@redhat.com>
Date: Thu Jan 21 18:45:04 2010 +0530
rules: Add symlink rule for virtio ports
virtio ports spawned by the virtio_console.c driver can have 'names'
assigned to them by hosts. The ports are distinguishable using these
names. Make a rule to create a symlink to the chardev associated for a
port with a name.
The symlink created is:
/dev/virtio-ports/org.libvirt.console0 -> /dev/vport0p0
if the first port for the first device was given a name of
'org.libvirt.console0'.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Changed by Harald Hoyer
diff -up udev-145/rules/rules.d/50-udev-default.rules.virtio udev-145/rules/rules.d/50-udev-default.rules
--- udev-145/rules/rules.d/50-udev-default.rules.virtio 2010-03-19 11:47:36.000000000 +0100
+++ udev-145/rules/rules.d/50-udev-default.rules 2010-03-19 11:47:52.000000000 +0100
@@ -17,6 +17,9 @@ KERNEL=="ppp", MODE="0600"
KERNEL=="mwave", NAME="modems/mwave", GROUP="dialout"
KERNEL=="hvc*|hvsi*", GROUP="dialout"
+# virtio serial / console ports
+KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
+
# mem
KERNEL=="null|zero|full|random|urandom", MODE="0666"
KERNEL=="mem|kmem|port|nvram", GROUP="kmem", MODE="0640"

96
udev-post.init Normal file
View file

@ -0,0 +1,96 @@
#!/bin/bash
#
# udev-post Post script for udev, after all filesystems are mounted
#
# Authors: Harald Hoyer <harald@redhat.com>
#
# chkconfig: 12345 26 75
# description: Moves the generated persistent udev rules to /etc/udev/rules.d
#
### BEGIN INIT INFO
# Default-Start: 12345
# Default-Stop: 0 6
# Required-Start: $local_fs
# Required-Stop:
# Short-Description: Moves the generated persistent udev rules to /etc/udev/rules.d
# Description: Moves the generated persistent udev rules to /etc/udev/rules.d
# Provides: udev-post
### END INIT INFO
. /etc/rc.d/init.d/functions
. /etc/sysconfig/udev
# See how we were called.
case "$1" in
start|reload)
[ -w /var/lock/subsys ] || exit 4
STRING=$"Retrigger failed udev events"
echo -n $STRING
/sbin/udevadm trigger --retry-failed
success "$STRING"
echo
STRING=$"Adding udev persistent rules"
# copy the rules generated before / was mounted read-write
for file in /dev/.udev/tmp-rules--*; do
dest=${file##*tmp-rules--}
# check, if anything is todo
[ "$dest" = '*' ] && exit 0
echo -n $STRING
cat $file >> /etc/udev/rules.d/$dest
rc=$?
rm -f $file
if [ "$rc" -eq "0" ]; then
success "$STRING"
echo
elif [ "$rc" -eq "1" ]; then
failure "$STRING"
echo
fi
done
touch /var/lock/subsys/udev-post
exit 0
;;
stop)
[ -w /var/lock/subsys ] || exit 4
STRING=$"Generating udev makedev cache file"
MAKEDEV="/sbin/MAKEDEV"
USE_MD5="false"
[ -x /usr/bin/md5sum -a "$UDEV_USE_MAKEDEV_CACHE" == "yes" ] && USE_MD5="true"
if [ "$USE_MD5" == "true" -a -x "$MAKEDEV" ]; then
for i in /etc/udev/makedev.d/*.nodes; do
if [ -f "$i" ]; then
# use a little caching to speedup things
md5=$(/usr/bin/md5sum "$i"|(read a b; echo $a))
md5file="/var/lib/udev/makedev.d/${md5}.sh"
if [ ! -f "$md5file" ]; then
echo -n $STRING
( sed -e 's,#.*,,g' "$i" | \
xargs $MAKEDEV -x -a -S ) \
> "$md5file"
rc=$?
if [ "$rc" -eq "0" ]; then
success "$STRING"
echo
elif [ "$rc" -eq "1" ]; then
failure "$STRING"
echo
fi
fi
fi
done
fi
rm -f /var/lock/subsys/udev-post
exit 0
;;
status)
exit 3
;;
*)
echo $"Usage: $0 {start|stop|reload}"
exit 2
esac
exit 0

View file

@ -0,0 +1,55 @@
From: Kay Sievers <kay.sievers@vrfy.org>
Date: Thu, 18 Mar 2010 10:14:32 +0000 (+0100)
Subject: cdrom_id: open non-mounted optical media with O_EXCL
X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=38a3cde11bc77af49a96245b8a8a0f2b583a344c
cdrom_id: open non-mounted optical media with O_EXCL
This should prevent confusing drives during CD burning sessions. Based
on a patch from Harald Hoyer.
---
diff --git a/extras/cdrom_id/cdrom_id.c b/extras/cdrom_id/cdrom_id.c
index 2380b15..e485768 100644
--- a/extras/cdrom_id/cdrom_id.c
+++ b/extras/cdrom_id/cdrom_id.c
@@ -112,6 +112,30 @@ static unsigned long long int cd_media_session_last_offset;
#define ASC(errcode) (((errcode) >> 8) & 0xFF)
#define ASCQ(errcode) ((errcode) & 0xFF)
+static int is_mounted(const char *device)
+{
+ struct stat statbuf;
+ FILE *fp;
+ int maj, min;
+ int mounted = 0;
+
+ if (stat(device, &statbuf) < 0)
+ return -ENODEV;
+
+ fp = fopen("/proc/self/mountinfo", "r");
+ if (fp == NULL)
+ return -ENOSYS;
+ while (fscanf(fp, "%*s %*s %i:%i %*[^\n]", &maj, &min) == 2) {
+ /* printf("got %u %u\n", maj, min); */
+ if (makedev(maj, min) == statbuf.st_rdev) {
+ mounted = 1;
+ break;
+ }
+ }
+ fclose(fp);
+ return mounted;
+}
+
static void info_scsi_cmd_err(struct udev *udev, char *cmd, int err)
{
if (err == -1) {
@@ -568,7 +592,7 @@ int main(int argc, char *argv[])
goto exit;
}
- fd = open(node, O_RDONLY | O_NONBLOCK);
+ fd = open(node, O_RDONLY|O_NONBLOCK|(is_mounted(node) ? 0 : O_EXCL));
if (fd < 0) {
info(udev, "unable to open '%s'\n", node);
fprintf(stderr, "unable to open '%s'\n", node);

View file

@ -0,0 +1,34 @@
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Tue, 9 Feb 2010 14:47:47 +0000 (+0100)
Subject: Fix brightness keys on MSI Wind U-100
X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=d7e2d38c1f0ead2239808dd117577a99a3ad3cde
Fix brightness keys on MSI Wind U-100
The MSI Wind 100 generates ACPI/input events on the LNXVIDEO input device. On
top of that, the video module/BIOS synthesize some extra event on atkbd as an
echo of actually changing the brightness.
Ignore the wrong and useless atkbd ones, to avoid event loops.
Many thanks to Hans de Goede for tracking this down!
https://launchpad.net/bugs/415023
---
diff --git a/extras/keymap/95-keymap.rules b/extras/keymap/95-keymap.rules
index 51c8c3b..684619b 100644
--- a/extras/keymap/95-keymap.rules
+++ b/extras/keymap/95-keymap.rules
@@ -98,6 +98,11 @@ ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $
ENV{DMI_VENDOR}=="MICRO-STAR*", RUN+="keymap $name micro-star"
+# some MSI models generate ACPI/input events on the LNXVIDEO input devices,
+# plus some extra synthesized ones on atkbd as an echo of actually changing the
+# brightness; so ignore those atkbd ones, to avoid loops
+ENV{DMI_VENDOR}=="MICRO-STAR*", ATTR{[dmi/id]product_name}=="*U-100*|*U100*|*N033", RUN+="keymap $name 0xF7 reserved 0xF8 reserved"
+
ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN+="keymap $name inventec-symphony_6.0_7.0"
ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000"

View file

@ -0,0 +1,29 @@
From: Marco d'Itri <md@linux.it>
Date: Thu, 7 Jan 2010 15:17:22 +0000 (+0100)
Subject: rules: udev-acl - add firewire video devices
X-Git-Tag: 150~4
X-Git-Url: http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git;a=commitdiff_plain;h=fa0612104ad30d4228aa7782308a77e21b7f6fb5
rules: udev-acl - add firewire video devices
---
diff --git a/extras/udev-acl/70-acl.rules b/extras/udev-acl/70-acl.rules
index f135bff..ab2984c 100644
--- a/extras/udev-acl/70-acl.rules
+++ b/extras/udev-acl/70-acl.rules
@@ -33,6 +33,15 @@ SUBSYSTEM=="input", SUBSYSTEMS=="sound", ENV{ACL_MANAGE}="1"
SUBSYSTEM=="video4linux", ENV{ACL_MANAGE}="1"
SUBSYSTEM=="dvb", ENV{ACL_MANAGE}="1"
+# IIDC devices: industrial cameras and some webcams
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", ENV{ACL_MANAGE}="1"
+# AV/C devices: camcorders, set-top boxes, TV sets, audio devices, and more
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", ENV{ACL_MANAGE}="1"
+
+# old style firewire devices
+KERNEL=="dv1394-[0-9]*", ENV{ACL_MANAGE}="1"
+KERNEL=="video1394-[0-9]*", ENV{ACL_MANAGE}="1"
+
# fingerprint readers
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="2016", ENV{ACL_MANAGE}="1"

1506
udev.spec

File diff suppressed because it is too large Load diff

4
udev.sysconfig Normal file
View file

@ -0,0 +1,4 @@
# If set to "yes", generates cache shell files of what MAKEDEV would do.
# May speedup some systems with slow disks.
# EXPERIMENTAL - use at your own risk
UDEV_USE_MAKEDEV_CACHE="no"

1
upstream Normal file
View file

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

54
upstream-key.gpg Normal file
View file

@ -0,0 +1,54 @@
pub 1024D/517D0F0E 2000-10-10 Linux Kernel Archives Verification Key <ftpadmin@kernel.org>
Key fingerprint = C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E
sub 4096g/E50A8F2A 2000-10-10
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.3 (GNU/Linux)
Comment: For info see http://www.gnupg.org
mQGiBDnirDkRBADCTL/iUTeZKb0tiAcKdZdsUP/KSnrGGjlinolUAsUC0D6/hUB1
RdCpJOOERTIEr1yvehqDM7veRhNMoxJNQxa/sSrkywey5qc8uaskUNEqenimq/70
bahWJeoWXjad68mQFh65lULnHQrrioeJnh9UpyGJppNb/yIjdnymH9aYEwCglgP7
UegBzH22h8NVQEK2PWWbyUUD/jQA4lI0wRWcL9HpkYkHcH0LTKRB9zYpQYtyvzJi
yTGwJyFMfYNXy0RT11dICeLkf3HMR84hkPERKMhALobLxVUbfc7j2AygmzGphWGy
DH/xjptQP/zrsq87ylYRONK18w1J42cm+yZa4XThMDPJMrb9/l8qnxU1JnW7W1al
HKTpBACbs+91KLqrnIGcF44TMwxgUj5CUrayPoEnLU+ZMBqfSjmu8RqEYmTxJCKv
7erBFSuazBGj5X7twunrtrW3bxO63MbLbHjfXSRrMnKOb8dRULIg6eWAnoAx8VVZ
YjrOpwAntU3WxYOpbiCHt9kLbb+N5rvNtFcmOqRRQaCIUFOOaLQ8TGludXggS2Vy
bmVsIEFyY2hpdmVzIFZlcmlmaWNhdGlvbiBLZXkgPGZ0cGFkbWluQGtlcm5lbC5v
cmc+iFUEExECABUFAjnirDkDCwoDAxUDAgMWAgECF4AACgkQyGugalF9Dw4MNACe
JiQTyCmQzPGou2cl/RyOXj79kYYAnAsT6xt72hp/PFiywYM9vBsDVv9niQEVAwUQ
OeKwNWx5eAAqlgcFAQEdZgf/Vn2dMKrn8021NhavP0uA3pHGRmdKQ2WJBdLiN2tv
LkpAioZtho+op+xBz8j1zdIJQ/7XWko869KHge2BAFwA8rWDzjtaAWdE0Jo/NiAR
epUwV2FdRRwSxIcNG2CCPyJnfPokRqjdl2z9k2PkwidHSq+2k6JxCWnOcIXChSKf
kHnemtA65ixAlhuxvyN3MPuYs1jAHyDGcyMfomp1qH9tXFQhhyXRrG2eMAfslstC
XGXLcoLN3O2BMR/fG2GlV6kOqGOvoMIW3clVeQLQ9B1yyekKiVY6Vg+CgK5qhg8z
9tjH4f33zzNDwsx1WSCOU/1LIPzFBNbR9QtTF2XmOUfRs4hGBBARAgAGBQI54rBc
AAoJEH2d7s4ry8YhmjsAoMUW9RxfXBSos0A6LwGd+5pXv/MRAKCYFLG2T4GSV+qf
iRsXnrgDHQHD04hGBBARAgAGBQI54rOZAAoJEPKlddweGoeC/+sAoL5f7JF21mRe
Z8VV4nhh7prm+idSAKCMXDWW/tBOeJDYpiEhgyGSGgJJWrkEDQQ54q+cEBAAjRmb
txamcZ9EYsQTnQvVL2l6vY5Rnbc1JDdcyHEV1kH5OwZWqvckL4QgKKBbTQwyB9pC
o0nGK4PkBbrwL0outfHQ5jl9DUzTKIu+asWUyf3fxfUV6j2A6BMo59KNnJzUyJ2+
B5na6NN8nEqEtmogROtjT8LkOvYwqD4A/5re2vwtie+h5yU6A+JbyGQF6lFxThZj
4WGctBgCcDBqRkPAG8DFFAdeN5SMAArktCYuUGXi2q88EDoOs3Ykw0kB8+ZFECz/
4/b93so5Wt2hC15cxAJoXFfR3mXHm40EHzMdEublWV4blB2KvFocQC74/H74QPUk
cWlc6EhPodKvcuOfTimDxXaiGNFONUPgNAmCXeVoOapdWpb3x7iOHPwSaXeJSrO9
fc4GtVjDv90DT2ekK7cvYk8s6B3t7p7W21Xi+hRgrw63B3HElr01gdMZY5XA5ey/
WmnyBS6LOxXlnVBE+2uSQ+aZHqrLpXcRvq2ZonOziDSE0i940ZvIwlSzn0U5BQWl
9hBDQw78RacYqaFvlpcGiPj75bScB4eemxV6Wdo9mtK0Vrr+9bWScXHEv7did4X+
7tBWKbA8M+g290OSzjeQBGLuPmbjxzEKH9jcUumzBzzC5x5GFh7On9TLXQ4K/oRT
6QQpS93YrTVbR60G4MKsePWLJmg7IgYUtNdLGjsAAwUP/0aAAq8CmWtourj1XxNY
pFmOAU45d65fPWVadKyF++B+uDyRNYN7HQCqrJ7ddn0sH7OBtlE8yaBYgR0TFly9
9+LqQO4r4IGCw2TBgA5tKnOWoPGEzvrLeoxR3SnPrKBlDvx6Rr9h3OJ9UV5u/NLh
mCP9iN10gWCGzsWbONc6qD6PugbTur44D6s4CRK9xfliSrtG3GBHW914UKjJeB9s
e3oc1rkmNv39kKcu33w4XVETAj4qpXnwoJvy639dfvnQt1TWFjIt20iP7m+jkT3B
b526uJ5GuJl6r8sm5OYYRs5cLigvUzRZVgYnjjqlRRACx0WcinKK55Li2Pq4qcRV
vSE5Tr3kTUTGxdmy113FbscrhLhesGALv3Hb7jeeWC8jviGEaHppgUumR6v0hsI1
rZ3K8kCjFRAYV8OKtcEeMqjouArGi5dn0ClmG4lwH4SEdqC/TRNWGG+iVpWf5yCj
9mvtvUhLtl6QjXHLrJdSGyafvqR1EQMJadFt4URvx0M7tqZIcwPUnb+7Oc+J96po
e/EQmnm6rFnTpWz0BbY4mbJC7vUH4JyLs0nlxiKrBjaO9C1DSAKBpjqaga8dQe1Z
kLOI2F7IWFeKV2LaMl+ZvvfWMECNcqNW2fkCuP9Fpz5K+xg21TwovVy93aWKgFL6
06jK51oQp3fW86xXK9ZGKYqQiEYEGBECAAYFAjnir5wACgkQyGugalF9Dw5M9QCg
hhmHalzWf8B3AVrjPrtrRHA1vlgAn3YRlU5l0V5W1iXvHXQCUHIESpgm
=SZZb
-----END PGP PUBLIC KEY BLOCK-----