Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "Tool for managing software RAID under Linux" |
| 2 | HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/" |
| 3 | |
| 4 | # Some files are GPLv2+ while others are GPLv2. |
| 5 | LICENSE = "GPLv2 & GPLv2+" |
| 6 | LIC_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 | |
| 11 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ |
| 12 | file://run-ptest \ |
| 13 | file://mdadm-3.3.2_x32_abi_time_t.patch \ |
| 14 | file://mdadm-fix-ptest-build-errors.patch \ |
| 15 | file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \ |
| 16 | file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \ |
| 17 | file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ |
| 18 | file://0001-Compute-abs-diff-in-a-standard-compliant-way.patch \ |
| 19 | file://0001-fix-gcc-8-format-truncation-warning.patch \ |
| 20 | file://mdadm.init \ |
| 21 | file://mdmonitor.service \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | " |
| 23 | SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598" |
| 24 | SRC_URI[sha256sum] = "ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a" |
| 25 | |
| 26 | inherit autotools-brokensep ptest systemd |
| 27 | |
| 28 | SYSTEMD_SERVICE_${PN} = "mdmonitor.service mdmon@.service" |
| 29 | SYSTEMD_AUTO_ENABLE = "disable" |
| 30 | |
| 31 | CFLAGS_append_toolchain-clang = " -Wno-error=address-of-packed-member" |
| 32 | |
| 33 | # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h |
| 34 | # prevents 64-bit userland from seeing this definition, instead defaulting |
| 35 | # to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get |
| 36 | # int-ll64.h included |
| 37 | CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' |
| 38 | CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' |
| 39 | CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' |
| 40 | |
| 41 | EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' |
| 42 | |
| 43 | DEBUG_OPTIMIZATION_append = " -Wno-error" |
| 44 | |
| 45 | do_compile() { |
| 46 | # Point to right sbindir |
| 47 | sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" ${S}/Makefile |
| 48 | oe_runmake SYSROOT="${STAGING_DIR_TARGET}" |
| 49 | } |
| 50 | |
| 51 | do_install() { |
| 52 | export STRIP="" |
| 53 | autotools_do_install |
| 54 | } |
| 55 | |
| 56 | do_install_append() { |
| 57 | install -d ${D}/${sysconfdir}/ |
| 58 | install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf |
| 59 | install -d ${D}/${systemd_unitdir}/system |
| 60 | install -m 644 ${WORKDIR}/mdmonitor.service ${D}/${systemd_unitdir}/system |
| 61 | install -m 644 ${S}/systemd/mdmon@.service ${D}/${systemd_unitdir}/system |
| 62 | install -d ${D}/${sysconfdir}/init.d |
| 63 | install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor |
| 64 | } |
| 65 | |
| 66 | do_compile_ptest() { |
| 67 | oe_runmake test |
| 68 | } |
| 69 | |
| 70 | do_install_ptest() { |
| 71 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests |
| 72 | cp ${S}/test ${D}${PTEST_PATH} |
| 73 | sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test |
| 74 | ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm |
| 75 | for prg in test_stripe swap_super raid6check |
| 76 | do |
| 77 | install -D -m 755 $prg ${D}${PTEST_PATH}/ |
| 78 | done |
| 79 | } |
| 80 | |
| 81 | RDEPENDS_${PN}-ptest += "bash" |
| 82 | RRECOMMENDS_${PN}-ptest += " \ |
| 83 | coreutils \ |
| 84 | util-linux \ |
| 85 | kernel-module-loop \ |
| 86 | kernel-module-linear \ |
| 87 | kernel-module-raid0 \ |
| 88 | kernel-module-raid1 \ |
| 89 | kernel-module-raid10 \ |
| 90 | kernel-module-raid456 \ |
| 91 | " |