Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 1 | SUMMARY = "Tool for managing software RAID under Linux" |
| 2 | HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/" |
| 3 | DESCRIPTION = "mdadm is a Linux utility used to manage and monitor software RAID devices." |
| 4 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 5 | # Some files are GPL-2.0-only while others are GPL-2.0-or-later. |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 6 | LICENSE = "GPL-2.0-only & GPL-2.0-or-later" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 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://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-fix-gcc-8-format-truncation-warning.patch \ |
| 19 | file://debian-no-Werror.patch \ |
| 20 | file://0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch \ |
| 21 | file://mdadm.init \ |
| 22 | file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ |
| 23 | file://include_sysmacros.patch \ |
| 24 | file://0001-mdadm-skip-test-11spare-migration.patch \ |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 25 | file://0001-Fix-parsing-of-r-in-monitor-manager-mode.patch \ |
| 26 | file://0001-Makefile-install-mdcheck.patch \ |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 27 | file://0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch \ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 28 | file://0001-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \ |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 29 | file://0001-mdadm-Fix-optional-write-behind-parameter.patch \ |
| 30 | file://0001-tests-02lineargrow-clear-the-superblock-at-every-ite.patch \ |
| 31 | file://0001-tests-00raid0-add-a-test-that-validates-raid0-with-l.patch \ |
| 32 | file://0001-tests-fix-raid0-tests-for-0.90-metadata.patch \ |
| 33 | file://0001-tests-00readonly-Run-udevadm-settle-before-setting-r.patch \ |
| 34 | file://0001-tests-04update-metadata-avoid-passing-chunk-size-to.patch \ |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 35 | file://0001-DDF-Cleanup-validate_geometry_ddf_container.patch \ |
| 36 | file://0002-DDF-Fix-NULL-pointer-dereference-in-validate_geometr.patch \ |
| 37 | file://0003-mdadm-Grow-Fix-use-after-close-bug-by-closing-after-.patch \ |
| 38 | file://0004-monitor-Avoid-segfault-when-calling-NULL-get_bad_blo.patch \ |
| 39 | file://0005-mdadm-test-Mark-and-ignore-broken-test-failures.patch \ |
| 40 | file://0006-tests-Add-broken-files-for-all-broken-tests.patch \ |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame^] | 41 | file://0001-tests-add-.broken-files-for-04update-uuid-and-07reve.patch \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 42 | " |
| 43 | |
| 44 | SRC_URI[sha256sum] = "461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d" |
| 45 | |
| 46 | inherit autotools-brokensep ptest systemd |
| 47 | |
| 48 | DEPENDS = "udev" |
| 49 | |
| 50 | SYSTEMD_SERVICE:${PN} = "mdmonitor.service" |
| 51 | SYSTEMD_AUTO_ENABLE = "disable" |
| 52 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 53 | # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h |
| 54 | # prevents 64-bit userland from seeing this definition, instead defaulting |
| 55 | # to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get |
| 56 | # int-ll64.h included |
| 57 | CFLAGS:append:powerpc64 = ' -D__SANE_USERSPACE_TYPES__' |
| 58 | CFLAGS:append:mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' |
| 59 | CFLAGS:append:mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' |
| 60 | |
| 61 | EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" SYSTEMD_DIR=${systemd_system_unitdir} \ |
| 62 | BINDIR="${base_sbindir}" UDEVDIR="${nonarch_base_libdir}/udev"' |
| 63 | |
| 64 | DEBUG_OPTIMIZATION:append = " -Wno-error" |
| 65 | |
| 66 | do_compile() { |
| 67 | oe_runmake SYSROOT="${STAGING_DIR_TARGET}" |
| 68 | } |
| 69 | |
| 70 | do_install() { |
| 71 | export STRIP="" |
| 72 | autotools_do_install |
| 73 | } |
| 74 | |
| 75 | do_install:append() { |
| 76 | install -d ${D}/${sysconfdir}/ |
| 77 | install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf |
| 78 | install -d ${D}/${sysconfdir}/init.d |
| 79 | install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor |
| 80 | } |
| 81 | |
| 82 | do_install:append() { |
| 83 | oe_runmake install-systemd DESTDIR=${D} |
| 84 | } |
| 85 | |
| 86 | do_compile_ptest() { |
| 87 | oe_runmake test |
| 88 | } |
| 89 | |
| 90 | do_install_ptest() { |
| 91 | cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests |
| 92 | cp ${S}/test ${D}${PTEST_PATH} |
| 93 | sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/test |
| 94 | sed -e 's!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/tests/* |
| 95 | sed -i -e '/echo -ne "$_script... "/d' \ |
| 96 | -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \ |
| 97 | -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \ |
| 98 | -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \ |
| 99 | ${D}${PTEST_PATH}/test |
| 100 | |
| 101 | chmod +x ${D}${PTEST_PATH}/test |
| 102 | |
| 103 | ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm |
| 104 | for prg in test_stripe swap_super raid6check |
| 105 | do |
| 106 | install -D -m 755 $prg ${D}${PTEST_PATH}/ |
| 107 | done |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame^] | 108 | |
| 109 | # Disable tests causing intermittent autobuilder failures |
| 110 | echo "intermittent failure on autobuilder" > ${D}${PTEST_PATH}/tests/19raid6check.broken |
| 111 | echo "intermittent failure on autobuilder" > ${D}${PTEST_PATH}/tests/20raid5journal.broken |
| 112 | echo "intermittent failure on autobuilder" > ${D}${PTEST_PATH}/tests/21raid5cache.broken |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 113 | } |
| 114 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 115 | RDEPENDS:${PN} += "bash" |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 116 | RDEPENDS:${PN}-ptest += " \ |
| 117 | bash \ |
| 118 | e2fsprogs-mke2fs \ |
| 119 | util-linux-lsblk \ |
| 120 | util-linux-losetup \ |
| 121 | util-linux-blockdev \ |
| 122 | strace \ |
| 123 | " |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 124 | RRECOMMENDS:${PN}-ptest += " \ |
| 125 | coreutils \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 126 | kernel-module-loop \ |
| 127 | kernel-module-linear \ |
| 128 | kernel-module-raid0 \ |
| 129 | kernel-module-raid1 \ |
| 130 | kernel-module-raid10 \ |
| 131 | kernel-module-raid456 \ |
| 132 | " |
| 133 | |
| 134 | FILES:${PN} += "${systemd_unitdir}/*" |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame^] | 135 | |
| 136 | # strace is not yet ported to rv32 |
| 137 | RDEPENDS:${PN}-ptest:remove:riscv32 = "strace" |
| 138 | do_install_ptest:append:riscv32 () { |
| 139 | echo "disabled, no strace" > ${D}${PTEST_PATH}/tests/07revert-grow.broken |
| 140 | echo "disabled, no strace" > ${D}${PTEST_PATH}/tests/07revert-inplace.broken |
| 141 | } |