From b93bd0e85ec9e5646e08639771e8d787820df8f8 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Sun, 9 Jan 2022 23:27:25 +0100 Subject: mdadm: update 4.1 -> 4.2 Drop 0001-Compute-abs-diff-in-a-standard-compliant-way.patch (upstream refactored code) mdadm-fix-ptest-build-errors.patch (upstream fixed the issue) (From OE-Core rev: acf82e36996c082f52c02d50b06965f74ef87430) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- .../recipes-test/images/oe-selftest-image.bb | 3 +- ...pute-abs-diff-in-a-standard-compliant-way.patch | 31 ------ .../mdadm/files/debian-no-Werror.patch | 19 ++-- .../mdadm/files/mdadm-fix-ptest-build-errors.patch | 43 -------- meta/recipes-extended/mdadm/mdadm_4.1.bb | 108 --------------------- meta/recipes-extended/mdadm/mdadm_4.2.bb | 107 ++++++++++++++++++++ 6 files changed, 121 insertions(+), 190 deletions(-) delete mode 100644 meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch delete mode 100644 meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch delete mode 100644 meta/recipes-extended/mdadm/mdadm_4.1.bb create mode 100644 meta/recipes-extended/mdadm/mdadm_4.2.bb diff --git a/meta-selftest/recipes-test/images/oe-selftest-image.bb b/meta-selftest/recipes-test/images/oe-selftest-image.bb index 5d4d10eef6..e295943ae5 100644 --- a/meta-selftest/recipes-test/images/oe-selftest-image.bb +++ b/meta-selftest/recipes-test/images/oe-selftest-image.bb @@ -1,6 +1,7 @@ SUMMARY = "An image used during oe-selftest tests" -IMAGE_INSTALL = "packagegroup-core-boot dropbear" +# libudev is needed for deploy mdadm via devtool +IMAGE_INSTALL = "packagegroup-core-boot dropbear libudev" IMAGE_FEATURES = "debug-tweaks" IMAGE_LINGUAS = " " diff --git a/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch b/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch deleted file mode 100644 index 803a59b3ec..0000000000 --- a/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b273e892bd6aaafe448f84356abb78a6d463e784 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 7 Dec 2018 17:22:39 -0800 -Subject: [PATCH] Compute abs diff in a standard compliant way - -This make it a bit less implementation defined and silences clang -warning -Wabsolute-value - -| super-intel.c:2822:20: error: taking the absolute value of unsigned type 'unsi -gned long long' has no effect [-Werror,-Wabsolute-value] - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - super-intel.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/super-intel.c b/super-intel.c -index 6438987..10d7218 100644 ---- a/super-intel.c -+++ b/super-intel.c -@@ -2819,7 +2819,7 @@ static unsigned long long calc_component_size(struct imsm_map *map, - * 2048 blocks per each device. If the difference is higher it means - * that array size was expanded and num_data_stripes was not updated. - */ -- if ((unsigned int)abs(calc_dev_size - dev_size) > -+ if ((unsigned int)abs((int)calc_dev_size - (int)dev_size) > - (1 << SECT_PER_MB_SHIFT) * member_disks) { - component_size = dev_size / member_disks; - dprintf("Invalid num_data_stripes in metadata; expected=%llu, found=%llu\n", diff --git a/meta/recipes-extended/mdadm/files/debian-no-Werror.patch b/meta/recipes-extended/mdadm/files/debian-no-Werror.patch index e66a15cd79..fa90647489 100644 --- a/meta/recipes-extended/mdadm/files/debian-no-Werror.patch +++ b/meta/recipes-extended/mdadm/files/debian-no-Werror.patch @@ -1,5 +1,7 @@ -From: martin f. krafft -Subject: Remove -Werror from compiler flags +From adb75f0bdec97dbe4aa15cc988d349775f7995ff Mon Sep 17 00:00:00 2001 +From: "martin f. krafft" +Date: Mon, 3 Jan 2022 19:14:12 +0000 +Subject: [PATCH] Remove -Werror from compiler flags -Werror seems like a bad idea on released/packaged code because a toolchain update (introducing new warnings) could break the build. We'll let upstream @@ -8,15 +10,18 @@ use it to beautify the code, but remove it for out builds. Signed-off-by: martin f. krafft Upstream-Status: Pending + --- - Makefile | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/Makefile b/Makefile +index 716c97c..40354ea 100644 --- a/Makefile +++ b/Makefile -@@ -48,7 +48,7 @@ endif - - CC ?= $(CROSS_COMPILE)gcc +@@ -50,7 +50,7 @@ ifeq ($(origin CC),default) + CC := $(CROSS_COMPILE)gcc + endif CXFLAGS ?= -ggdb -CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter +CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter diff --git a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch deleted file mode 100644 index 8e2a8a9043..0000000000 --- a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 911f6ea9be0c334885aeff66853b111cbd4066df Mon Sep 17 00:00:00 2001 -From: "Maxin B. John" -Date: Wed, 10 Feb 2016 17:28:05 +0200 -Subject: [PATCH] mdadm-fix-ptest-build-errors - -builds fail with ptest enabled: - -| restripe.c: In function 'test_stripes': -| restripe.c:845:4: error: ignoring return value of 'read', declared with -| attribute warn_unused_result [-Werror=unused-result] -| read(source[i], stripes[i], chunk_size); -| ^ -| cc1: all warnings being treated as errors -| Makefile:214: recipe for target 'test_stripe' failed - -Upstream-Status: Pending - -Signed-off-by: Maxin B. John - ---- - restripe.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/restripe.c b/restripe.c -index 31b07e8..592ba5d 100644 ---- a/restripe.c -+++ b/restripe.c -@@ -864,10 +864,14 @@ int test_stripes(int *source, unsigned long long *offsets, - - while (length > 0) { - int disk; -+ ssize_t ret; - - for (i = 0 ; i < raid_disks ; i++) { - lseek64(source[i], offsets[i]+start, 0); -- read(source[i], stripes[i], chunk_size); -+ ret = read(source[i], stripes[i], chunk_size); -+ if (ret == -1) { -+ printf("Read Failed\n"); -+ } - } - for (i = 0 ; i < data_disks ; i++) { - int disk = geo_map(i, start/chunk_size, raid_disks, diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-extended/mdadm/mdadm_4.1.bb deleted file mode 100644 index 35535aef86..0000000000 --- a/meta/recipes-extended/mdadm/mdadm_4.1.bb +++ /dev/null @@ -1,108 +0,0 @@ -SUMMARY = "Tool for managing software RAID under Linux" -HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/" -DESCRIPTION = "mdadm is a Linux utility used to manage and monitor software RAID devices." - -# Some files are GPLv2+ while others are GPLv2. -LICENSE = "GPLv2 & GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ - file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" - - -SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ - file://run-ptest \ - file://mdadm-3.3.2_x32_abi_time_t.patch \ - file://mdadm-fix-ptest-build-errors.patch \ - file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \ - file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \ - file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ - file://0001-Compute-abs-diff-in-a-standard-compliant-way.patch \ - file://0001-fix-gcc-8-format-truncation-warning.patch \ - file://debian-no-Werror.patch \ - file://0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch \ - file://mdadm.init \ - file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ - file://include_sysmacros.patch \ - file://0001-mdadm-skip-test-11spare-migration.patch \ - " - -SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598" -SRC_URI[sha256sum] = "ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a" - -inherit autotools-brokensep ptest systemd - -SYSTEMD_SERVICE:${PN} = "mdmonitor.service" -SYSTEMD_AUTO_ENABLE = "disable" - -CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" - -# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h -# prevents 64-bit userland from seeing this definition, instead defaulting -# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get -# int-ll64.h included -CFLAGS:append:powerpc64 = ' -D__SANE_USERSPACE_TYPES__' -CFLAGS:append:mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' -CFLAGS:append:mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' - -EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" SYSTEMD_DIR=${systemd_system_unitdir} \ - BINDIR="${base_sbindir}" UDEVDIR="${nonarch_base_libdir}/udev"' - -DEBUG_OPTIMIZATION:append = " -Wno-error" - -do_compile() { - oe_runmake SYSROOT="${STAGING_DIR_TARGET}" -} - -do_install() { - export STRIP="" - autotools_do_install -} - -do_install:append() { - install -d ${D}/${sysconfdir}/ - install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf - install -d ${D}/${sysconfdir}/init.d - install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor -} - -do_install:append() { - oe_runmake install-systemd DESTDIR=${D} -} - -do_compile_ptest() { - oe_runmake test -} - -do_install_ptest() { - cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests - cp ${S}/test ${D}${PTEST_PATH} - sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/test - sed -e 's!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/tests/* - sed -i -e '/echo -ne "$_script... "/d' \ - -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \ - -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \ - -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \ - ${D}${PTEST_PATH}/test - - chmod +x ${D}${PTEST_PATH}/test - - ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm - for prg in test_stripe swap_super raid6check - do - install -D -m 755 $prg ${D}${PTEST_PATH}/ - done -} - -RDEPENDS:${PN}-ptest += "bash e2fsprogs-mke2fs" -RRECOMMENDS:${PN}-ptest += " \ - coreutils \ - util-linux \ - kernel-module-loop \ - kernel-module-linear \ - kernel-module-raid0 \ - kernel-module-raid1 \ - kernel-module-raid10 \ - kernel-module-raid456 \ -" - -FILES:${PN} += "${systemd_unitdir}/*" diff --git a/meta/recipes-extended/mdadm/mdadm_4.2.bb b/meta/recipes-extended/mdadm/mdadm_4.2.bb new file mode 100644 index 0000000000..fa51364283 --- /dev/null +++ b/meta/recipes-extended/mdadm/mdadm_4.2.bb @@ -0,0 +1,107 @@ +SUMMARY = "Tool for managing software RAID under Linux" +HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/" +DESCRIPTION = "mdadm is a Linux utility used to manage and monitor software RAID devices." + +# Some files are GPLv2+ while others are GPLv2. +LICENSE = "GPLv2 & GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ + file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" + + +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ + file://run-ptest \ + file://mdadm-3.3.2_x32_abi_time_t.patch \ + file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \ + file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \ + file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ + file://0001-fix-gcc-8-format-truncation-warning.patch \ + file://debian-no-Werror.patch \ + file://0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch \ + file://mdadm.init \ + file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ + file://include_sysmacros.patch \ + file://0001-mdadm-skip-test-11spare-migration.patch \ + " + +SRC_URI[sha256sum] = "461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d" + +inherit autotools-brokensep ptest systemd + +DEPENDS = "udev" + +SYSTEMD_SERVICE:${PN} = "mdmonitor.service" +SYSTEMD_AUTO_ENABLE = "disable" + +CFLAGS:append:toolchain-clang = " -Wno-error=address-of-packed-member" + +# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h +# prevents 64-bit userland from seeing this definition, instead defaulting +# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get +# int-ll64.h included +CFLAGS:append:powerpc64 = ' -D__SANE_USERSPACE_TYPES__' +CFLAGS:append:mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' +CFLAGS:append:mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' + +EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" SYSTEMD_DIR=${systemd_system_unitdir} \ + BINDIR="${base_sbindir}" UDEVDIR="${nonarch_base_libdir}/udev"' + +DEBUG_OPTIMIZATION:append = " -Wno-error" + +do_compile() { + oe_runmake SYSROOT="${STAGING_DIR_TARGET}" +} + +do_install() { + export STRIP="" + autotools_do_install +} + +do_install:append() { + install -d ${D}/${sysconfdir}/ + install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf + install -d ${D}/${sysconfdir}/init.d + install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor +} + +do_install:append() { + oe_runmake install-systemd DESTDIR=${D} +} + +do_compile_ptest() { + oe_runmake test +} + +do_install_ptest() { + cp -R --no-dereference --preserve=mode,links -v ${S}/tests ${D}${PTEST_PATH}/tests + cp ${S}/test ${D}${PTEST_PATH} + sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/test + sed -e 's!/var/tmp!/mdadm-testing-dir!g' -i ${D}${PTEST_PATH}/tests/* + sed -i -e '/echo -ne "$_script... "/d' \ + -e 's/echo "succeeded"/echo -e "PASS: $_script"/g' \ + -e '/save_log fail/N; /_fail=1/i\\t\t\techo -ne "FAIL: $_script"' \ + -e '/die "dmesg prints errors when testing $_basename!"/i\\t\t\t\techo -ne "FAIL: $_script" &&' \ + ${D}${PTEST_PATH}/test + + chmod +x ${D}${PTEST_PATH}/test + + ln -s ${base_sbindir}/mdadm ${D}${PTEST_PATH}/mdadm + for prg in test_stripe swap_super raid6check + do + install -D -m 755 $prg ${D}${PTEST_PATH}/ + done +} + +RDEPENDS:${PN}-ptest += "bash e2fsprogs-mke2fs" +RRECOMMENDS:${PN}-ptest += " \ + coreutils \ + util-linux \ + kernel-module-loop \ + kernel-module-linear \ + kernel-module-raid0 \ + kernel-module-raid1 \ + kernel-module-raid10 \ + kernel-module-raid456 \ +" + +FILES:${PN} += "${systemd_unitdir}/*" -- cgit v1.2.3-54-g00ecf