Gentoo Archives: gentoo-commits

From: "Matthias Schwarzott (zzam)" <zzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udev/files: udev-151-readd-hd-rules.diff
Date: Fri, 29 Jan 2010 21:14:49
Message-Id: E1NayAx-0006Tj-JG@stork.gentoo.org
1 zzam 10/01/29 21:14:47
2
3 Added: udev-151-readd-hd-rules.diff
4 Log:
5 Version bumped. Fix selinux, Bug #297317. Add use-flag old-hd-rules to control re-adding of rules for /dev/hd*, Bug #300627.
6 (Portage version: 2.1.7.16/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 sys-fs/udev/files/udev-151-readd-hd-rules.diff
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-151-readd-hd-rules.diff?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udev/files/udev-151-readd-hd-rules.diff?rev=1.1&content-type=text/plain
13
14 Index: udev-151-readd-hd-rules.diff
15 ===================================================================
16 diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules
17 index 132a680..a3e8e3c 100644
18 --- a/extras/cdrom_id/60-cdrom_id.rules
19 +++ b/extras/cdrom_id/60-cdrom_id.rules
20 @@ -2,4 +2,4 @@
21
22 # import optical drive properties
23 ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \
24 - KERNEL=="sr[0-9]*|xvd*", IMPORT{program}="cdrom_id --export $tempnode"
25 + KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]|xvd*", IMPORT{program}="cdrom_id --export $tempnode"
26 diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules
27 index f8556d1..ba07079 100644
28 --- a/rules/rules.d/50-udev-default.rules
29 +++ b/rules/rules.d/50-udev-default.rules
30 @@ -77,9 +77,12 @@ SUBSYSTEM=="block", GROUP="disk"
31
32 # floppy
33 SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
34 +SUBSYSTEM=="block", KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k"
35 +KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions"
36
37 # cdrom
38 SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom"
39 +SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom"
40 SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
41 KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
42 KERNEL=="pktcdvd", GROUP="cdrom"
43 diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
44 index 89041a9..6f12a9a 100644
45 --- a/rules/rules.d/60-persistent-storage.rules
46 +++ b/rules/rules.d/60-persistent-storage.rules
47 @@ -12,12 +12,21 @@ SUBSYSTEM!="block", GOTO="persistent_storage_end"
48 # skip rules for inappropriate block devices
49 KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end"
50
51 +# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
52 +KERNEL=="hd*[!0-9]", ATTR{removable}=="1", SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", GOTO="persistent_storage_end"
53 +KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
54 +
55 # ignore partitions that span the entire disk
56 TEST=="whole_disk", GOTO="persistent_storage_end"
57
58 # for partitions import parent information
59 ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
60
61 +# by-id (hardware serial number)
62 +KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
63 +KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
64 +KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
65 +
66 # USB devices use their own serial number
67 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
68 # ATA devices with their own "ata" kernel subsystem