[OE-core] [PATCH 1/1] mdadm: make udev rules dir configurable

Qi.Chen at windriver.com Qi.Chen at windriver.com
Tue Nov 20 09:34:33 UTC 2012


From: Chen Qi <Qi.Chen at windriver.com>

mdadm hardcodes the udev rules dir to be '/lib/udev/rules.d'.
However, udev configs its base library directory to be ${base_libdir}
instead of '/lib'. Thus if the target has powerpc64 architecture,
the mdraid.rules file will be missing on the target, as the library
directory is 'lib64'.

This patch makes the udev rules dir of mdadm configurable, so that
the mdraid.rules file will not be missing on any target.

[YOCTO #2804]

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
---
 .../mdadm-make-udev-rules-dir-configurable.patch   |   30 ++++++++++++++++++++
 meta/recipes-extended/mdadm/mdadm_3.2.6.bb         |    4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/mdadm/files/mdadm-make-udev-rules-dir-configurable.patch

diff --git a/meta/recipes-extended/mdadm/files/mdadm-make-udev-rules-dir-configurable.patch b/meta/recipes-extended/mdadm/files/mdadm-make-udev-rules-dir-configurable.patch
new file mode 100644
index 0000000..46928e9
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/mdadm-make-udev-rules-dir-configurable.patch
@@ -0,0 +1,30 @@
+Make the udev rules dir configurable.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
+
+Index: mdadm-3.2.6/Makefile
+=========================================================
+--- mdadm-3.2.6/Makefile
++++ mdadm-3.2.6/Makefile
+@@ -98,6 +98,7 @@ MANDIR  = /usr/share/man
+ MAN4DIR = $(MANDIR)/man4
+ MAN5DIR = $(MANDIR)/man5
+ MAN8DIR = $(MANDIR)/man8
++udevrulesdir ?= "/lib/udev.d/rules"
+ 
+ OBJS =  mdadm.o config.o policy.o mdstat.o  ReadMe.o util.o maps.o lib.o \
+ 	Manage.o Assemble.o Build.o \
+@@ -255,7 +256,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
+ 	$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
+ 
+ install-udev: udev-md-raid.rules
+-	$(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules
++	$(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(udevrulesdir)/64-md-raid.rules
+ 
+ uninstall:
+ 	rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
+-- 
+1.7.5.4
+
diff --git a/meta/recipes-extended/mdadm/mdadm_3.2.6.bb b/meta/recipes-extended/mdadm/mdadm_3.2.6.bb
index 7b6a6c7..e0af60e 100644
--- a/meta/recipes-extended/mdadm/mdadm_3.2.6.bb
+++ b/meta/recipes-extended/mdadm/mdadm_3.2.6.bb
@@ -8,10 +8,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                     file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
                     file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.bz2 \
 	    file://mdadm-3.2.2_fix_for_x32.patch \
+            file://mdadm-make-udev-rules-dir-configurable.patch \
 	  "
 
 SRC_URI[md5sum] = "3e255dc71e5144bbcb872788ca647267"
@@ -21,6 +22,7 @@ CFLAGS += "-fno-strict-aliasing"
 
 inherit autotools
 
+EXTRA_OEMAKE += "udevrulesdir=${base_libdir}/udev/rules.d"
 # We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header
 do_configure_prepend () {
 	sed -i -e '/.*ansidecl.h.*/d' ${S}/sha1.h
-- 
1.7.9.5





More information about the Openembedded-core mailing list