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 \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 20 | file://debian-no-Werror.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 21 | file://mdadm.init \ |
| 22 | file://mdmonitor.service \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 23 | " |
| 24 | SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598" |
| 25 | SRC_URI[sha256sum] = "ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a" |
| 26 | |
| 27 | inherit autotools-brokensep ptest systemd |
| 28 | |
| 29 | SYSTEMD_SERVICE_${PN} = "mdmonitor.service mdmon@.service" |
| 30 | SYSTEMD_AUTO_ENABLE = "disable" |
| 31 | |
| 32 | CFLAGS_append_toolchain-clang = " -Wno-error=address-of-packed-member" |
| 33 | |
| 34 | # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h |
| 35 | # prevents 64-bit userland from seeing this definition, instead defaulting |
| 36 | # to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get |
| 37 | # int-ll64.h included |
| 38 | CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' |
| 39 | CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' |
| 40 | CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' |
| 41 | |
| 42 | EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' |
| 43 | |
| 44 | DEBUG_OPTIMIZATION_append = " -Wno-error" |
| 45 | |
| 46 | do_compile() { |
| 47 | # Point to right sbindir |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 48 | sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" -e "s;SYSTEMD_DIR=/lib/systemd/system;SYSTEMD_DIR=${systemd_unitdir}/system;" ${S}/Makefile |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | oe_runmake SYSROOT="${STAGING_DIR_TARGET}" |
| 50 | } |
| 51 | |
| 52 | do_install() { |
| 53 | export STRIP="" |
| 54 | autotools_do_install |
| 55 | } |
| 56 | |
| 57 | do_install_append() { |
| 58 | install -d ${D}/${sysconfdir}/ |
| 59 | install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 60 | install -d ${D}/${sysconfdir}/init.d |
| 61 | install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor |
| 62 | } |
| 63 | |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 64 | do_install_append() { |
| 65 | oe_runmake install-systemd DESTDIR=${D} |
| 66 | } |
| 67 | |
| 68 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 69 | do_compile_ptest() { |
| 70 | oe_runmake test |
| 71 | } |
| 72 | |
| 73 | do_install_ptest() { |
| 74 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests |
| 75 | cp ${S}/test ${D}${PTEST_PATH} |
| 76 | sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test |
| 77 | ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm |
| 78 | for prg in test_stripe swap_super raid6check |
| 79 | do |
| 80 | install -D -m 755 $prg ${D}${PTEST_PATH}/ |
| 81 | done |
| 82 | } |
| 83 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 84 | RDEPENDS_${PN}-ptest += "bash e2fsprogs-mke2fs" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 85 | RRECOMMENDS_${PN}-ptest += " \ |
| 86 | coreutils \ |
| 87 | util-linux \ |
| 88 | kernel-module-loop \ |
| 89 | kernel-module-linear \ |
| 90 | kernel-module-raid0 \ |
| 91 | kernel-module-raid1 \ |
| 92 | kernel-module-raid10 \ |
| 93 | kernel-module-raid456 \ |
| 94 | " |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 95 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 96 | FILES_${PN} += "${systemd_unitdir}/*" |