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/" |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 3 | DESCRIPTION = "mdadm is a Linux utility used to manage and monitor software RAID devices." |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | |
| 5 | # Some files are GPLv2+ while others are GPLv2. |
| 6 | LICENSE = "GPLv2 & GPLv2+" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 8 | file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ |
| 9 | file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" |
| 10 | |
| 11 | |
| 12 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ |
| 13 | file://run-ptest \ |
| 14 | file://mdadm-3.3.2_x32_abi_time_t.patch \ |
| 15 | file://mdadm-fix-ptest-build-errors.patch \ |
| 16 | file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \ |
| 17 | file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \ |
| 18 | file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ |
| 19 | file://0001-Compute-abs-diff-in-a-standard-compliant-way.patch \ |
| 20 | file://0001-fix-gcc-8-format-truncation-warning.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 21 | file://debian-no-Werror.patch \ |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 22 | file://0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch \ |
Andrew Geissler | 5a43b43 | 2020-06-13 10:46:56 -0500 | [diff] [blame] | 23 | file://mdadm.init \ |
| 24 | file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 25 | file://include_sysmacros.patch \ |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 26 | file://0001-mdadm-skip-test-11spare-migration.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 27 | " |
Brad Bishop | 79641f2 | 2019-09-10 07:20:22 -0400 | [diff] [blame] | 28 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 29 | SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598" |
| 30 | SRC_URI[sha256sum] = "ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a" |
| 31 | |
| 32 | inherit autotools-brokensep ptest systemd |
| 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | SYSTEMD_SERVICE:${PN} = "mdmonitor.service" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | SYSTEMD_AUTO_ENABLE = "disable" |
| 36 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | |
| 39 | # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h |
| 40 | # prevents 64-bit userland from seeing this definition, instead defaulting |
| 41 | # to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get |
| 42 | # int-ll64.h included |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | CFLAGS:append:powerpc64 = ' -D__SANE_USERSPACE_TYPES__' |
| 44 | CFLAGS:append:mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' |
| 45 | CFLAGS:append:mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 47 | EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" SYSTEMD_DIR=${systemd_unitdir}/system \ |
| 48 | BINDIR="${base_sbindir}" UDEVDIR="${nonarch_base_libdir}/udev"' |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | DEBUG_OPTIMIZATION:append = " -Wno-error" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | |
| 52 | do_compile() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 53 | oe_runmake SYSROOT="${STAGING_DIR_TARGET}" |
| 54 | } |
| 55 | |
| 56 | do_install() { |
| 57 | export STRIP="" |
| 58 | autotools_do_install |
| 59 | } |
| 60 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 61 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 62 | install -d ${D}/${sysconfdir}/ |
| 63 | install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 64 | install -d ${D}/${sysconfdir}/init.d |
| 65 | install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor |
| 66 | } |
| 67 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 68 | do_install:append() { |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 69 | oe_runmake install-systemd DESTDIR=${D} |
| 70 | } |
| 71 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 72 | do_compile_ptest() { |
| 73 | oe_runmake test |
| 74 | } |
| 75 | |
| 76 | do_install_ptest() { |
| 77 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests |
| 78 | cp ${S}/test ${D}${PTEST_PATH} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 79 | sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/test |
| 80 | sed -e 's!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/tests/* |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 81 | sed -i -e '/echo -ne "$_script... "/d' \ |
| 82 | -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \ |
| 83 | -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \ |
| 84 | -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \ |
| 85 | ${D}${PTEST_PATH}/test |
| 86 | |
| 87 | chmod +x ${D}${PTEST_PATH}/test |
| 88 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 89 | ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm |
| 90 | for prg in test_stripe swap_super raid6check |
| 91 | do |
| 92 | install -D -m 755 $prg ${D}${PTEST_PATH}/ |
| 93 | done |
| 94 | } |
| 95 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 96 | RDEPENDS:${PN}-ptest += "bash e2fsprogs-mke2fs" |
| 97 | RRECOMMENDS:${PN}-ptest += " \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 98 | coreutils \ |
| 99 | util-linux \ |
| 100 | kernel-module-loop \ |
| 101 | kernel-module-linear \ |
| 102 | kernel-module-raid0 \ |
| 103 | kernel-module-raid1 \ |
| 104 | kernel-module-raid10 \ |
| 105 | kernel-module-raid456 \ |
| 106 | " |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 107 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 108 | FILES:${PN} += "${systemd_unitdir}/*" |