blob: 142dfddbf245d19d012f695a8c849fcb14a22d4e [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Tool for managing software RAID under Linux"
2HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
3
4# Some files are GPLv2+ while others are GPLv2.
5LICENSE = "GPLv2 & GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
7 file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
8 file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
9
10
11SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
12 file://mdadm-3.2.2_fix_for_x32.patch \
13 file://gcc-4.9.patch \
14 file://mdadm-3.3.2_x32_abi_time_t.patch \
15 file://0001-Fix-typo-in-comparision.patch \
16 file://mdadm-fix-ptest-build-errors.patch \
17 file://0001-util.c-include-poll.h-instead-of-sys-poll.h.patch \
18 file://0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch \
19 file://0001-Fix-some-type-comparison-problems.patch \
20 file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
21 file://run-ptest \
22 "
23SRC_URI[md5sum] = "04b8b21f637540350f8517c7e68d3c63"
24SRC_URI[sha256sum] = "27d0be4627d38a12ddcd1c1c3721d649d4e89e1093914497e22b57245cda8808"
25
26CFLAGS += "-fno-strict-aliasing"
27inherit autotools-brokensep
28
29EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
30# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
31# prevents 64-bit userland from seeing this definition, instead defaulting
32# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
33# int-ll64.h included
34CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__'
35CFLAGS_append_mips64 = ' -D__SANE_USERSPACE_TYPES__'
36CFLAGS_append_mips64n32 = ' -D__SANE_USERSPACE_TYPES__'
37
38do_compile() {
39 oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
40}
41
42do_install() {
43 export STRIP=""
44 autotools_do_install
45}
46
47FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
48
49inherit ptest
50
51do_compile_ptest() {
52 oe_runmake test
53}
54
55do_install_ptest() {
56 cp -a ${S}/tests ${D}${PTEST_PATH}/tests
57 cp ${S}/test ${D}${PTEST_PATH}
58 sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
59 ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
60 for prg in test_stripe swap_super raid6check
61 do
62 install -D -m 755 $prg ${D}${PTEST_PATH}/
63 done
64}
65RDEPENDS_${PN}-ptest += "bash"
66RRECOMMENDS_${PN}-ptest += " \
67 coreutils \
68 util-linux \
69 kernel-module-loop \
70 kernel-module-linear \
71 kernel-module-raid0 \
72 kernel-module-raid1 \
73 kernel-module-raid10 \
74 kernel-module-raid456 \
75"