]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
udev: install disk/by-partuuid rules
authorSage Weil <sage@inktank.com>
Fri, 17 May 2013 01:40:29 +0000 (18:40 -0700)
committerSage Weil <sage@inktank.com>
Fri, 17 May 2013 01:40:29 +0000 (18:40 -0700)
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>
Makefile.am
debian/ceph.install
debian/rules
udev/60-ceph-partuuid-workaround.rules [new file with mode: 0644]

index 03cb914079fe9b95d56cc5a1d5777a51434d793e..e7dd86ee1ae3f3c6f4a1c3fd33accede3be2c220 100644 (file)
@@ -10,6 +10,7 @@ EXTRA_DIST += \
        src/test/cli \
        src/test/downloads \
        udev/50-rbd.rules \
+       udev/60-ceph-partuuid-workaround.rules \
        udev/95-ceph-osd.rules \
        udev/95-ceph-osd-alt.rules
 
index 57bba905292943e608859631cedf2e0b34e69cfe..69dfc6d5954247e84b598b6ad1e33b371ea20c4a 100644 (file)
@@ -1,5 +1,6 @@
 etc/bash_completion.d/ceph
 lib/udev/rules.d/95-ceph-osd.rules
+lib/udev/rules.d/60-ceph-partuuid-workaround.rules
 usr/sbin/ceph-create-keys
 usr/sbin/ceph-disk
 usr/sbin/ceph-disk-activate
index 2492577543cfde36f720141304955ceb74a5e9fd..52c91bc7359e267fc57a80c0a3cf8bfd1d067e96 100755 (executable)
@@ -85,6 +85,7 @@ install: build
        $(MAKE) DESTDIR=$(DESTDIR) install
        sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
        install -D -m 644 udev/50-rbd.rules $(DESTDIR)/lib/udev/rules.d/50-rbd.rules
+       install -D -m 644 udev/60-ceph-partuuid-workaround.rules $(DESTDIR)/lib/udev/rules.d/60-ceph-partuuid-workaround.rules
        install -D -m 644 udev/95-ceph-osd.rules $(DESTDIR)/lib/udev/rules.d/95-ceph-osd.rules
 
 # Add here commands to install the package into debian/testpack.
diff --git a/udev/60-ceph-partuuid-workaround.rules b/udev/60-ceph-partuuid-workaround.rules
new file mode 100644 (file)
index 0000000..a1aa060
--- /dev/null
@@ -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"