diff options
author | Sage Weil <sage@inktank.com> | 2013-05-16 18:40:29 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-16 18:40:47 -0700 |
commit | 7bc7c9d4bc6f5bbadbb5e6f9844a0e1f66373c90 (patch) | |
tree | 1189b97b7a58132fa2afecd2583415ebeab9153e | |
parent | c2acecbdab93177227a80a114ecc4ce71dbdbe49 (diff) | |
download | ceph-7bc7c9d4bc6f5bbadbb5e6f9844a0e1f66373c90.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>
(cherry picked from commit d8d7113c35b59902902d487738888567e3a6b933)
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | debian/ceph.install | 1 | ||||
-rwxr-xr-x | debian/rules | 1 | ||||
-rw-r--r-- | udev/60-ceph-partuuid-workaround.rules | 34 |
4 files changed, 37 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 03cb914079f..e7dd86ee1ae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/debian/ceph.install b/debian/ceph.install index 57bba905292..69dfc6d5954 100644 --- a/debian/ceph.install +++ b/debian/ceph.install @@ -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 diff --git a/debian/rules b/debian/rules index 2492577543c..52c91bc7359 100755 --- a/debian/rules +++ b/debian/rules @@ -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 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" |