summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-05-16 18:40:29 -0700
committerSage Weil <sage@inktank.com>2013-05-16 18:40:29 -0700
commitd8d7113c35b59902902d487738888567e3a6b933 (patch)
treedff0efffeefb94f7824139f06fcfbf1e5ca21548 /udev
parent9b9d322c20e4d3cfa5d40023cd28c020068178f1 (diff)
downloadceph-d8d7113c35b59902902d487738888567e3a6b933.tar.gz
udev: install disk/by-partuuid rules
Wheezy's udev (175-7.2) has broken rules for the /dev/disk/by-partuuid/ symlinks that ceph-disk relies on. Install parallel rules that work. On new udev, this is harmless; old older udev, this will make life better. Fixes: #4865 Backport: cuttlefish Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'udev')
-rw-r--r--udev/60-ceph-partuuid-workaround.rules34
1 files changed, 34 insertions, 0 deletions
diff --git a/udev/60-ceph-partuuid-workaround.rules b/udev/60-ceph-partuuid-workaround.rules
new file mode 100644
index 00000000000..a1aa060d452
--- /dev/null
+++ b/udev/60-ceph-partuuid-workaround.rules
@@ -0,0 +1,34 @@
+#
+# this is a kludge installed by ceph to fix the /dev/disk/by-partuuid
+# symlinks on systems with old udev (< 180). it's a stripped down
+# version of a newer 60-persistent-storage.rules file that hopefully
+# captures the same set of conditions for setting up those symlinks.
+#
+
+# forward scsi device event to corresponding block device
+ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+ACTION=="remove", GOTO="persistent_storage_end_two"
+
+SUBSYSTEM!="block", GOTO="persistent_storage_end_two"
+
+# skip rules for inappropriate block devices
+KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end_two"
+
+# ignore partitions that span the entire disk
+TEST=="whole_disk", GOTO="persistent_storage_end_two"
+
+# for partitions import parent information
+ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
+
+# skip unpartitioned removable media devices from drivers which do not send "change" events
+ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end_two"
+
+# probe filesystem metadata of disks
+KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+# by-partlabel/by-partuuid links (partition metadata)
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
+
+LABEL="persistent_storage_end_two"