mdadm: make udev rules dir configurable
cover mdadm: make udev rules dir configurable
From: Chen Qi <[email protected]>
The following changes since commit 9acfef96333ffe6e08998e6fd69187c14532d26c:
yocto-bsp: update qemu machine.conf template (2012-11-18 16:42:10 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/mdadm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/mdadm
Chen Qi (1):
mdadm: make udev rules dir configurable
.../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
Signature · 1 line
1.7.9.5
PATCH 1/1 mdadm: make udev rules dir configurable
From: Chen Qi <[email protected]>
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]
--- .../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
meta/recipes-extended/mdadm/files/mdadm-make-udev-rules-dir-configurable.patch new file +30 -0
@@ -0,0 +1,30 @@ +Make the udev rules dir configurable. + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Chen Qi <[email protected]> + +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 +
meta/recipes-extended/mdadm/mdadm_3.2.6.bb +3 -1
@@ -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
Signature · 1 line
1.7.9.5
Quoted 8 lines · On Tue, 2012-11-20 at 17:34 +0800, [email protected] wrote:
From: Chen Qi <[email protected]>
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'.
Quoted 4 lines
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]
This is a bit of a tricky one. I suspect in this case we need to install all the udev rules to one place and have an udev look in that place, regardless of which multilib it was compiled for.
We already have this problem with systemd_unitdir. I think we need to do something like set:
nonarchlib = "/lib"
and then use this value in places where we want it to be invariant (yet still allow the layout to be configurable).
So your patch starts to help with this but there is more we need to do.
Cheers,
Richard
Quoted 22 lines · Richard Purdie
Quoted 8 lines · On Tue, 2012-11-20 at 17:34 +0800, [email protected] wrote:
From: Chen Qi<[email protected]>
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'.Quoted 4 lines
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]
This is a bit of a tricky one. I suspect in this case we need to install all the udev rules to one place and have an udev look in that place, regardless of which multilib it was compiled for.
We already have this problem with
systemd_unitdir. I think we need to do something like set:nonarchlib = "/lib"
Quoted 10 lines
and then use this value in places where we want it to be invariant (yet still allow the layout to be configurable).
So your patch starts to help with this but there is more we need to do.
Cheers,
Richard
Hi Richard,
Do you mean that what needs to be fixed is udev instead of mdadm? Should I rework on this patch?
Thanks,
Chen Qi