summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-extended/mdadm
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-extended/mdadm')
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch31
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch152
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch21
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch53
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch11
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-fix-gcc-8-format-truncation-warning.patch39
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch48
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch37
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch28
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-skip-test-11spare-migration.patch43
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch12
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch31
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch75
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch59
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch33
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch128
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/debian-no-Werror.patch25
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch22
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/include_sysmacros.patch14
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch22
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch10
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/mdmonitor.service19
-rw-r--r--external/poky/meta/recipes-extended/mdadm/files/run-ptest18
-rw-r--r--external/poky/meta/recipes-extended/mdadm/mdadm_4.1.bb (renamed from external/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb)72
24 files changed, 312 insertions, 691 deletions
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch
new file mode 100644
index 00000000..803a59b3
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-Compute-abs-diff-in-a-standard-compliant-way.patch
@@ -0,0 +1,31 @@
+From b273e892bd6aaafe448f84356abb78a6d463e784 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+ 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/external/poky/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch
deleted file mode 100644
index 739652cd..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-From b83218de2623c0bbe9af355a81ae8385d7f30cfc Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 9 May 2018 12:56:41 -0700
-Subject: [PATCH] Disable gcc8 warnings
-
-This is needed until
-https://bugzilla.redhat.com/show_bug.cgi?id=1553958
-
-Fix super0.c issue which is triggered only in DEBUG_BUILD with -O1 (or any
-configuration without -ftree-vrp or with -fno-tree-vrp)
-
-super0.c: In function 'examine_super0':
-super0.c:238:32: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
- snprintf(nb, sizeof(nb), "%4d", d);
- ^
-
-Upstream-Status: Inappropriate [Workaround]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-
----
- Monitor.c | 4 +++-
- mdopen.c | 4 ++++
- super-ddf.c | 4 ++++
- super-intel.c | 6 ++++++
- super1.c | 5 +++++
- super0.c | 2 +-
- 6 files changed, 22 insertions(+), 1 deletion(-)
-
-diff --git a/super0.c b/super0.c
-index f5b4507..264b598 100644
---- a/super0.c
-+++ b/super0.c
-@@ -231,7 +231,7 @@
- d++) {
- mdp_disk_t *dp;
- char *dv;
-- char nb[11];
-+ char nb[12];
- int wonly, failfast;
- if (d>=0) dp = &sb->disks[d];
- else dp = &sb->this_disk;
-diff --git a/Monitor.c b/Monitor.c
-index 802a9d9..23b246b 100644
---- a/Monitor.c
-+++ b/Monitor.c
-@@ -441,7 +441,8 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info)
- event, dev);
- }
- }
--
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-truncation"
- static int check_array(struct state *st, struct mdstat_ent *mdstat,
- int test, struct alert_info *ainfo,
- int increments, char *prefer)
-@@ -683,6 +684,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
- return 1;
- return 0;
- }
-+#pragma GCC diagnostic pop
-
- static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
- int test, struct alert_info *info)
-diff --git a/mdopen.c b/mdopen.c
-index 685ca32..406aba4 100644
---- a/mdopen.c
-+++ b/mdopen.c
-@@ -26,6 +26,9 @@
- #include "md_p.h"
- #include <ctype.h>
-
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-truncation"
-+
- void make_parts(char *dev, int cnt)
- {
- /* make 'cnt' partition devices for 'dev'
-@@ -99,6 +102,7 @@ void make_parts(char *dev, int cnt)
- }
- free(name);
- }
-+#pragma GCC diagnostic pop
-
- /*
- * We need a new md device to assemble/build/create an array.
-diff --git a/super-ddf.c b/super-ddf.c
-index 1707ad1..e08d289 100644
---- a/super-ddf.c
-+++ b/super-ddf.c
-@@ -2846,6 +2846,9 @@ static void _set_config_size(struct phys_disk_entry *pde, const struct dl *dl)
- (unsigned long long)cfs, (unsigned long long)(dl->size-cfs));
- }
-
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-overflow"
-+
- /* Add a device to a container, either while creating it or while
- * expanding a pre-existing container
- */
-@@ -2981,6 +2984,7 @@ static int add_to_super_ddf(struct supertype *st,
-
- return 0;
- }
-+#pragma GCC diagnostic pop
-
- static int remove_from_super_ddf(struct supertype *st, mdu_disk_info_t *dk)
- {
-diff --git a/super-intel.c b/super-intel.c
-index 00a2925..44fbead 100644
---- a/super-intel.c
-+++ b/super-intel.c
-@@ -298,6 +298,11 @@ struct md_list {
- };
-
- #define pr_vrb(fmt, arg...) (void) (verbose && pr_err(fmt, ##arg))
-+#pragma GCC diagnostic push
-+# if __GNUC__ == 8
-+# pragma GCC diagnostic ignored "-Wstringop-truncation"
-+# endif
-+#pragma GCC diagnostic ignored "-Wformat-truncation"
-
- static __u8 migr_type(struct imsm_dev *dev)
- {
-@@ -11618,3 +11623,4 @@ struct superswitch super_imsm = {
- .get_bad_blocks = imsm_get_badblocks,
- #endif /* MDASSEMBLE */
- };
-+#pragma GCC diagnostic pop
-diff --git a/super1.c b/super1.c
-index 87a74cb..71c515f 100644
---- a/super1.c
-+++ b/super1.c
-@@ -1091,6 +1091,10 @@ static struct mdinfo *container_content1(struct supertype *st, char *subarray)
- return info;
- }
-
-+#pragma GCC diagnostic push
-+# if __GNUC__ == 8
-+# pragma GCC diagnostic ignored "-Wstringop-truncation"
-+#endif
- static int update_super1(struct supertype *st, struct mdinfo *info,
- char *update,
- char *devname, int verbose,
-@@ -1473,6 +1477,7 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info,
-
- return 1;
- }
-+#pragma GCC diagnostic pop
-
- struct devinfo {
- int fd;
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
index a8916140..298f276c 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -1,4 +1,4 @@
-From 1f5baf3ad95ae4c39efe4d8ad8b2e642b3a351da Mon Sep 17 00:00:00 2001
+From a9166bf422da1001bac9cc819386bf39b7cd1b73 Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Tue, 9 Feb 2016 11:44:01 +0200
Subject: [PATCH] Fix the path of corosync and dlm header files check
@@ -9,28 +9,18 @@ Fix it.
Upstream-Status: Inappropriate [Yocto specific]
Signed-off-by: Maxin B. John <maxin.john@intel.com>
----
-mdadm only works with corosync 2.x which provides header file corosync/cmap.h.
-If build mdadm with corosync 1.x, it fails with:
-
-| member.c:12:27: fatal error: corosync/cmap.h: No such file or directory
-| #include <corosync/cmap.h>
-| ^
-Build with corosync only header file corosync/cmap.h exists.
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
-index fd79cfb..34150a9 100644
+index 2767ac6..46bf57b 100644
--- a/Makefile
+++ b/Makefile
-@@ -80,8 +80,8 @@ MDMON_DIR = $(RUN_DIR)
- FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
+@@ -91,8 +91,8 @@ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
SYSTEMD_DIR=/lib/systemd/system
+ LIB_DIR=/usr/libexec/mdadm
-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
@@ -39,6 +29,3 @@ index fd79cfb..34150a9 100644
DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
---
-2.4.0
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch
new file mode 100644
index 00000000..b196084a
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-Revert-tests-wait-for-complete-rebuild-in-integrity-.patch
@@ -0,0 +1,53 @@
+From 02a41c3fd560fb5250186dd6b3cff6b21daa2e2b Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Mon, 15 Jul 2019 14:12:24 +0800
+Subject: [PATCH] Revert "tests: wait for complete rebuild in integrity checks"
+
+This reverts commit e2a8e9dcf67a28bc722fa5ab2c49b0bc452d4d74
+as the logic "check state 'U*'" will make the test enters
+infinite loop especially in qemu env, so revert it to
+use the previous logic "check wait" which also used
+commonly by other tests such as tests/02r5grow, tests/07revert-grow
+and etc.
+
+Upstream-Status: Submitted[https://marc.info/?l=linux-raid&m=156317157314030&w=2]
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ tests/01r5integ | 2 +-
+ tests/01raid6integ | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/01r5integ b/tests/01r5integ
+index 48676a2..ffb30ce 100644
+--- a/tests/01r5integ
++++ b/tests/01r5integ
+@@ -27,7 +27,7 @@ do
+ exit 1
+ fi
+ mdadm $md0 -a $i
+- while ! (check state 'U*'); do check wait; sleep 0.2; done
++ check wait
+ done
+ mdadm -S $md0
+ done
+diff --git a/tests/01raid6integ b/tests/01raid6integ
+index 12f4d81..c6fcdae 100644
+--- a/tests/01raid6integ
++++ b/tests/01raid6integ
+@@ -47,10 +47,10 @@ do
+ exit 1
+ fi
+ mdadm $md0 -a $first
+- while ! (check state 'U*_U*'); do check wait; sleep 0.2; done
++ check wait
+ done
+ mdadm $md0 -a $second
+- while ! (check state 'U*'); do check wait; sleep 0.2; done
++ check wait
+ totest="$totest $second"
+ done
+ mdadm -S $md0
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch
index a4b7b8ac..12bf6a59 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch
@@ -1,4 +1,4 @@
-From a129ee6d80f3b2cda0d827c35fa81a517cf6d505 Mon Sep 17 00:00:00 2001
+From 37c35f94d9d95dbd2b5f8a919f5478be51453590 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 13 Oct 2017 10:27:34 -0700
Subject: [PATCH] Use CC to check for implicit-fallthrough warning support
@@ -8,16 +8,16 @@ its possible that build host gcc is version 7+ but the
cross compile used for compiling mdadm is < version 7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
Upstream-Status: Pending
+---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
-index d207ee4..971f255 100644
+index 46bf57b..a075912 100644
--- a/Makefile
+++ b/Makefile
-@@ -48,7 +48,7 @@ ifdef WARN_UNUSED
+@@ -53,7 +53,7 @@ ifdef WARN_UNUSED
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
endif
@@ -26,6 +26,3 @@ index d207ee4..971f255 100644
ifneq "$(FALLTHROUGH)" "0"
CWFLAGS += -Wimplicit-fallthrough=0
endif
---
-2.14.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-fix-gcc-8-format-truncation-warning.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-fix-gcc-8-format-truncation-warning.patch
new file mode 100644
index 00000000..fa9c8cc8
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-fix-gcc-8-format-truncation-warning.patch
@@ -0,0 +1,39 @@
+From 3158d3788c2e0fb75ace2c89840bd8a977fb4cb0 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 14 Dec 2018 15:12:31 +0800
+Subject: [PATCH] fix gcc-8 format-truncation warning
+
+While compiling with `-Werror=format-truncation=', it failed
+[snip]
+|super0.c:236:32: error: 'snprintf' output may be truncated
+before the last format character [-Werror=format-truncation=]
+| snprintf(nb, sizeof(nb), "%4d", d);
+| ^
+|super0.c:236:3: note: 'snprintf' output between 5 and 12 bytes
+into a destination of size 11
+| snprintf(nb, sizeof(nb), "%4d", d);
+[snip]
+
+Upstream-Status: Submitted [https://github.com/neilbrown/mdadm/pull/34]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ super0.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/super0.c b/super0.c
+index 756cab5..12c28da 100644
+--- a/super0.c
++++ b/super0.c
+@@ -229,7 +229,7 @@ static void examine_super0(struct supertype *st, char *homehost)
+ d++) {
+ mdp_disk_t *dp;
+ char *dv;
+- char nb[11];
++ char nb[12];
+ int wonly, failfast;
+ if (d>=0) dp = &sb->disks[d];
+ else dp = &sb->this_disk;
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
deleted file mode 100644
index acd64ada..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-include-sys-sysmacros.h-for-major-minor-defintions.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 943616e5dffb79f307e4bd9b249d316212998750 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sun, 18 Dec 2016 08:30:51 +0000
-Subject: [PATCH] include <sys/sysmacros.h> for major/minor defintions
-
-glibc 2.25 is warning about it if applications depend on
-sys/types.h for these macros, it expects to be included
-from <sys/sysmacros.h>
-
-Fixes
-| Grow.c:3534:13: error: In the GNU C Library, "minor" is defined
-| by <sys/sysmacros.h>. For historical compatibility, it is
-| currently defined by <sys/types.h> as well, but we plan to
-| remove this soon. To use "minor", include <sys/sysmacros.h>
-| directly. If you did not intend to use a system-defined macro
-| "minor", you should undefine it after including <sys/types.h>. [-Werror]
-| Query.c: In function 'Query':
-| Query.c:105:13: error: In the GNU C Library, "makedev" is defined
-| by <sys/sysmacros.h>. For historical compatibility, it is
-| currently defined by <sys/types.h> as well, but we plan to
-| remove this soon. To use "makedev", include <sys/sysmacros.h>
-| directly. If you did not intend to use a system-defined macro
-| "makedev", you should undefine it after including <sys/types.h>. [-Werror]
-| makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev)
-| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Pending
-
- mdadm.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/mdadm.h b/mdadm.h
-index 8c8f4d1..3ce13b5 100755
---- a/mdadm.h
-+++ b/mdadm.h
-@@ -34,6 +34,7 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
- #endif
-
- #include <sys/types.h>
-+#include <sys/sysmacros.h>
- #include <sys/stat.h>
- #include <stdint.h>
- #include <stdlib.h>
---
-1.9.1
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
deleted file mode 100644
index ce15170c..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From aa09af0fe2ec0737fa04ffd00957532684e257b9 Mon Sep 17 00:00:00 2001
-From: Xiao Ni <xni@redhat.com>
-Date: Fri, 17 Mar 2017 19:55:42 +0800
-Subject: [PATCH 1/5] mdadm: Add Wimplicit-fallthrough=0 in Makefile
-
-There are many errors like 'error: this statement may fall through'.
-But the logic is right. So add the flag Wimplicit-fallthrough=0
-to disable the error messages. The method I use is from
-https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
-#index-Wimplicit-fallthrough-375
-
-Signed-off-by: Xiao Ni <xni@redhat.com>
-Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
----
-Upstream-Status: Backport
- Makefile | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/Makefile b/Makefile
-index 0f307ec..e1a7058 100644
---- a/Makefile
-+++ b/Makefile
-@@ -48,6 +48,11 @@ ifdef WARN_UNUSED
- CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
- endif
-
-+FALLTHROUGH := $(shell gcc -v --help 2>&1 | grep "implicit-fallthrough" | wc -l)
-+ifneq "$(FALLTHROUGH)" "0"
-+CWFLAGS += -Wimplicit-fallthrough=0
-+endif
-+
- ifdef DEBIAN
- CPPFLAGS += -DDEBIAN
- endif
---
-2.12.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch
new file mode 100644
index 00000000..e00287ca
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch
@@ -0,0 +1,28 @@
+From 5fdc0173cb4fcf8656f0889ad364d2549795607f Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Mon, 1 Jul 2019 11:34:49 +0800
+Subject: [PATCH] mdadm: add option -y for use syslog to recive event report
+
+fix service startup failed when there is
+No mail address or alert command
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ systemd/mdmonitor.service | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/systemd/mdmonitor.service b/systemd/mdmonitor.service
+index 46f7b88..3fc4687 100644
+--- a/systemd/mdmonitor.service
++++ b/systemd/mdmonitor.service
+@@ -13,4 +13,4 @@ DefaultDependencies=no
+ Environment= MDADM_MONITOR_ARGS=--scan
+ EnvironmentFile=-/run/sysconfig/mdadm
+ ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh
+-ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS
++ExecStart=BINDIR/mdadm --monitor -y $MDADM_MONITOR_ARGS
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-skip-test-11spare-migration.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-skip-test-11spare-migration.patch
new file mode 100644
index 00000000..3a192cc9
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm-skip-test-11spare-migration.patch
@@ -0,0 +1,43 @@
+From 1b83afa7c3121f819e72ea74883f8b6d61d6548e Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Fri, 6 Sep 2019 10:59:02 +0800
+Subject: [PATCH] mdadm: skip test 11spare-migration
+
+11spare-migration is a test series to check mdadm Monitor migrates spares
+according to rules in /etc/mdadm.conf defined by POLICY lines.
+
+[snip]
+for scan in no yes; do
+ for platform in 1.2 imsm; do
+ try
+ done
+done
+[snip]
+
+"try" includes near 20 sub testcase, so there are nearly 80 subcases need to run,
+so it will take long time than ptest-runner timeout limit, skip it as workaround.
+
+Upstream-Status: Inappropriate[oe-specific]
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ test | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/test b/test
+index 711a3c7..880dd1d 100755
+--- a/test
++++ b/test
+@@ -272,6 +272,9 @@ main() {
+ else
+ for script in $testdir/$prefix $testdir/$prefix*[^~]
+ do
++ if [ $script == "$testdir/11spare-migration" ];then
++ continue
++ fi
+ do_test $script
+ done
+ fi
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch
index 4cf80929..a1e7e593 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch
+++ b/external/poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-Undefine-dprintf-before-redefining.patch
@@ -1,4 +1,4 @@
-From 6d369e8f226594632ce4260129509daf7030de0a Mon Sep 17 00:00:00 2001
+From b431cb4e1ed060122fa300dc0008f74080d38f73 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 9 May 2016 22:03:57 +0000
Subject: [PATCH] mdadm.h: Undefine dprintf before redefining
@@ -14,17 +14,16 @@ In file included from policy.c:25:
/mnt/oe/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/bits/stdio2.h:145:12: note: previous definition is here
Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
Upstream-Status: Pending
-
+---
mdadm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mdadm.h b/mdadm.h
-index 230e60f..8c8f4d1 100755
+index 387e681..bb943bf 100644
--- a/mdadm.h
+++ b/mdadm.h
-@@ -1554,11 +1554,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container)
+@@ -1649,11 +1649,13 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container)
}
#ifdef DEBUG
@@ -38,6 +37,3 @@ index 230e60f..8c8f4d1 100755
#define dprintf(fmt, arg...) \
({ if (0) fprintf(stderr, "%s: %s: " fmt, Name, __func__, ##arg); 0; })
#define dprintf_cont(fmt, arg...) \
---
-1.9.1
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch b/external/poky/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch
deleted file mode 100644
index 44351b65..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From ab18f04cf89ef4e8521c81c50477e1363b2d333b Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 28 Apr 2018 09:46:12 -0700
-Subject: [PATCH] use memmove instead of memcpy on overlapping region
-
-Fixes
-super0.c:526:3: error: 'memcpy' accessing 3936 bytes at offsets 156 and 160 overlaps 3932 bytes at offset 160 [-Werror=restrict]
-
-Upstream-Status: Pending
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- super0.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/super0.c b/super0.c
-index f5b4507..264b598 100644
---- a/super0.c
-+++ b/super0.c
-@@ -523,7 +523,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
- * up 4 bytes before continuing
- */
- __u32 *sb32 = (__u32*)sb;
-- memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
-+ memmove(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7,
- sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1,
- (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4);
- if (verbose >= 0)
---
-2.17.0
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch b/external/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
deleted file mode 100644
index cbce053a..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0002-mdadm-Specify-enough-length-when-write-to-buffer.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From bb4df273041ba206008bdb0ada75ccd97c29f623 Mon Sep 17 00:00:00 2001
-From: Xiao Ni <xni@redhat.com>
-Date: Fri, 17 Mar 2017 19:55:43 +0800
-Subject: [PATCH 2/5] mdadm: Specify enough length when write to buffer
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-In Detail.c the buffer path in function Detail is defined as path[200],
-in fact the max lenth of content which needs to write to the buffer is
-287. Because the length of dname of struct dirent is 255.
-During building it reports error:
-error: ‘%s’ directive writing up to 255 bytes into a region of size 189
-[-Werror=format-overflow=]
-
-In function examine_super0 there is a buffer nb with length 5.
-But it need to show a int type argument. The lenght of max
-number of int is 10. So the buffer length should be 11.
-
-In human_size function the length of buf is 30. During building
-there is a error:
-output between 20 and 47 bytes into a destination of size 30.
-Change the length to 47.
-
-Signed-off-by: Xiao Ni <xni@redhat.com>
-Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
----
-Upstream-Status: Backport
- Detail.c | 2 +-
- super0.c | 2 +-
- util.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/Detail.c b/Detail.c
-index 509b0d4..cb33794 100644
---- a/Detail.c
-+++ b/Detail.c
-@@ -575,7 +575,7 @@ This is pretty boring
- printf(" Member Arrays :");
-
- while (dir && (de = readdir(dir)) != NULL) {
-- char path[200];
-+ char path[287];
- char vbuf[1024];
- int nlen = strlen(sra->sys_name);
- dev_t devid;
-diff --git a/super0.c b/super0.c
-index 938cfd9..f5b4507 100644
---- a/super0.c
-+++ b/super0.c
-@@ -231,7 +231,7 @@ static void examine_super0(struct supertype *st, char *homehost)
- d++) {
- mdp_disk_t *dp;
- char *dv;
-- char nb[5];
-+ char nb[11];
- int wonly, failfast;
- if (d>=0) dp = &sb->disks[d];
- else dp = &sb->this_disk;
-diff --git a/util.c b/util.c
-index f100972..32bd909 100644
---- a/util.c
-+++ b/util.c
-@@ -811,7 +811,7 @@ unsigned long calc_csum(void *super, int bytes)
- #ifndef MDASSEMBLE
- char *human_size(long long bytes)
- {
-- static char buf[30];
-+ static char buf[47];
-
- /* We convert bytes to either centi-M{ega,ibi}bytes or
- * centi-G{igi,ibi}bytes, with appropriate rounding,
---
-2.12.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch b/external/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
deleted file mode 100644
index dcec84ff..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From bc87af1314325b00c6ac002a60a2b0f0caa81e34 Mon Sep 17 00:00:00 2001
-From: Xiao Ni <xni@redhat.com>
-Date: Sat, 18 Mar 2017 10:33:44 +0800
-Subject: [PATCH 3/5] Replace snprintf with strncpy at some places to avoid
- truncation
-
-In gcc7 there are some building errors like:
-directive output may be truncated writing up to 31 bytes into a region of size 24
-snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
-
-It just need to copy one string to target. So use strncpy to replace it.
-
-For this line code: snprintf(str, MPB_SIG_LEN, %s, mpb->sig);
-Because mpb->sig has the content of version after magic, so
-it's better to use strncpy to replace snprintf too.
-
-Signed-off-by: Xiao Ni <xni@redhat.com>
-Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
----
-Upstream-Status: Backport
- super-intel.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/super-intel.c b/super-intel.c
-index 57c7e75..5499098 100644
---- a/super-intel.c
-+++ b/super-intel.c
-@@ -1811,7 +1811,8 @@ static void examine_super_imsm(struct supertype *st, char *homehost)
- __u32 reserved = imsm_reserved_sectors(super, super->disks);
- struct dl *dl;
-
-- snprintf(str, MPB_SIG_LEN, "%s", mpb->sig);
-+ strncpy(str, (char *)mpb->sig, MPB_SIG_LEN);
-+ str[MPB_SIG_LEN-1] = '\0';
- printf(" Magic : %s\n", str);
- snprintf(str, strlen(MPB_VERSION_RAID0), "%s", get_imsm_version(mpb));
- printf(" Version : %s\n", get_imsm_version(mpb));
-@@ -7142,14 +7143,16 @@ static int update_subarray_imsm(struct supertype *st, char *subarray,
-
- u->type = update_rename_array;
- u->dev_idx = vol;
-- snprintf((char *) u->name, MAX_RAID_SERIAL_LEN, "%s", name);
-+ strncpy((char *) u->name, name, MAX_RAID_SERIAL_LEN);
-+ u->name[MAX_RAID_SERIAL_LEN-1] = '\0';
- append_metadata_update(st, u, sizeof(*u));
- } else {
- struct imsm_dev *dev;
- int i;
-
- dev = get_imsm_dev(super, vol);
-- snprintf((char *) dev->volume, MAX_RAID_SERIAL_LEN, "%s", name);
-+ strncpy((char *) dev->volume, name, MAX_RAID_SERIAL_LEN);
-+ dev->volume[MAX_RAID_SERIAL_LEN-1] = '\0';
- for (i = 0; i < mpb->num_raid_devs; i++) {
- dev = get_imsm_dev(super, i);
- handle_missing(super, dev);
---
-2.12.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch b/external/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch
deleted file mode 100644
index 94fde42e..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 5da889032e2d99751ed9fe60016146e9ae8114cd Mon Sep 17 00:00:00 2001
-From: Xiao Ni <xni@redhat.com>
-Date: Sat, 18 Mar 2017 10:33:45 +0800
-Subject: [PATCH 4/5] mdadm: Forced type conversion to avoid truncation
-
-Gcc reports it needs 19 bytes to right to disk->serial. Because the
-type of argument i is int. But the meaning of i is failed disk
-number. So it doesn't need to use 19 bytes. Just add a type
-conversion to avoid this building error
-
-Signed-off-by: Xiao Ni <xni@redhat.com>
-Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
----
-Upstream-Status: Backport
- super-intel.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/super-intel.c b/super-intel.c
-index 5499098..4e466ff 100644
---- a/super-intel.c
-+++ b/super-intel.c
-@@ -5228,7 +5228,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
- disk->status = CONFIGURED_DISK | FAILED_DISK;
- disk->scsi_id = __cpu_to_le32(~(__u32)0);
- snprintf((char *) disk->serial, MAX_RAID_SERIAL_LEN,
-- "missing:%d", i);
-+ "missing:%d", (__u8)i);
- }
- find_missing(super);
- } else {
---
-2.12.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch b/external/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
deleted file mode 100644
index 3d9d3b90..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/0005-Add-a-comment-to-indicate-valid-fallthrough.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-From 09014233bf10900f7bd8390b3b64ff82bca45222 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Wed, 19 Apr 2017 12:04:15 -0700
-Subject: [PATCH 5/5] Add a comment to indicate valid fallthrough
-
-gcc7 warns about code with fallthroughs, this patch adds
-the comment to indicate a valid fallthrough, helps gcc7
-compiler warnings
-
-This works in cross and native compilation case
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- Grow.c | 4 ++++
- bitmap.c | 8 ++++++++
- mdadm.c | 2 ++
- super-intel.c | 1 +
- util.c | 1 +
- 5 files changed, 16 insertions(+)
-
-diff --git a/Grow.c b/Grow.c
-index 455c5f9..27c73b1 100755
---- a/Grow.c
-+++ b/Grow.c
-@@ -1257,6 +1257,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
- switch (info->new_level) {
- case 4:
- delta_parity = 1;
-+ /* fallthrough */
- case 0:
- re->level = 4;
- re->before.layout = 0;
-@@ -1284,10 +1285,12 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
-
- case 4:
- info->array.layout = ALGORITHM_PARITY_N;
-+ /* fallthrough */
- case 5:
- switch (info->new_level) {
- case 0:
- delta_parity = -1;
-+ /* fallthrough */
- case 4:
- re->level = info->array.level;
- re->before.data_disks = info->array.raid_disks - 1;
-@@ -1343,6 +1346,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
- case 4:
- case 5:
- delta_parity = -1;
-+ /* fallthrough */
- case 6:
- re->level = 6;
- re->before.data_disks = info->array.raid_disks - 2;
-diff --git a/bitmap.c b/bitmap.c
-index ccedfd3..a6ff091 100644
---- a/bitmap.c
-+++ b/bitmap.c
-@@ -82,13 +82,21 @@ static inline int count_dirty_bits_byte(char byte, int num_bits)
-
- switch (num_bits) { /* fall through... */
- case 8: if (byte & 128) num++;
-+ /* fallthrough */
- case 7: if (byte & 64) num++;
-+ /* fallthrough */
- case 6: if (byte & 32) num++;
-+ /* fallthrough */
- case 5: if (byte & 16) num++;
-+ /* fallthrough */
- case 4: if (byte & 8) num++;
-+ /* fallthrough */
- case 3: if (byte & 4) num++;
-+ /* fallthrough */
- case 2: if (byte & 2) num++;
-+ /* fallthrough */
- case 1: if (byte & 1) num++;
-+ /* fallthrough */
- default: break;
- }
-
-diff --git a/mdadm.c b/mdadm.c
-index c3a265b..2d06d3b 100644
---- a/mdadm.c
-+++ b/mdadm.c
-@@ -148,6 +148,7 @@ int main(int argc, char *argv[])
- mode == CREATE || mode == GROW ||
- mode == INCREMENTAL || mode == MANAGE)
- break; /* b means bitmap */
-+ /* fallthrough */
- case Brief:
- c.brief = 1;
- continue;
-@@ -828,6 +829,7 @@ int main(int argc, char *argv[])
-
- case O(INCREMENTAL,NoDegraded):
- pr_err("--no-degraded is deprecated in Incremental mode\n");
-+ /* fallthrough */
- case O(ASSEMBLE,NoDegraded): /* --no-degraded */
- c.runstop = -1; /* --stop isn't allowed for --assemble,
- * so we overload slightly */
-diff --git a/super-intel.c b/super-intel.c
-index 4e466ff..00a2925 100644
---- a/super-intel.c
-+++ b/super-intel.c
-@@ -3271,6 +3271,7 @@ static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info,
- << SECT_PER_MB_SHIFT;
- }
- }
-+ /* fallthrough */
- case MIGR_VERIFY:
- /* we could emulate the checkpointing of
- * 'sync_action=check' migrations, but for now
-diff --git a/util.c b/util.c
-index 32bd909..f2a4d19 100644
---- a/util.c
-+++ b/util.c
-@@ -335,6 +335,7 @@ unsigned long long parse_size(char *size)
- switch (*c) {
- case 'K':
- c++;
-+ /* fallthrough */
- default:
- s *= 2;
- break;
---
-2.12.2
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/debian-no-Werror.patch b/external/poky/meta/recipes-extended/mdadm/files/debian-no-Werror.patch
new file mode 100644
index 00000000..e66a15cd
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/debian-no-Werror.patch
@@ -0,0 +1,25 @@
+From: martin f. krafft <madduck@debian.org>
+Subject: 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
+use it to beautify the code, but remove it for out builds.
+
+Signed-off-by: martin f. krafft <madduck@debian.org>
+
+Upstream-Status: Pending
+---
+ Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -48,7 +48,7 @@ endif
+
+ CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
++CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
diff --git a/external/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/external/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
deleted file mode 100644
index df21399d..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-super-intel.c:5063:2: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
- snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
- ^
-cc1: all warnings being treated as errors
-make: *** [super-intel.o] Error 1
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Upstream-Status: Pending
-
-Index: mdadm-4.0/super-intel.c
-===================================================================
---- mdadm-4.0.orig/super-intel.c
-+++ mdadm-4.0/super-intel.c
-@@ -5725,7 +5725,7 @@ static int write_super_imsm_spares(struc
- spare->cache_size = mpb->cache_size;
- spare->pwr_cycle_count = __cpu_to_le32(1);
-
-- snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
-+ (void)snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
- MPB_SIGNATURE MPB_VERSION_RAID0);
-
- for (d = super->disks; d; d = d->next) {
diff --git a/external/poky/meta/recipes-extended/mdadm/files/include_sysmacros.patch b/external/poky/meta/recipes-extended/mdadm/files/include_sysmacros.patch
new file mode 100644
index 00000000..8a1d8342
--- /dev/null
+++ b/external/poky/meta/recipes-extended/mdadm/files/include_sysmacros.patch
@@ -0,0 +1,14 @@
+include sys/sysmacros.h for major/minor macro definitions
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -35,6 +35,7 @@ extern __off64_t lseek64 __P ((int __fd,
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <time.h>
diff --git a/external/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/external/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
index 00e6657e..7a2c8887 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
+++ b/external/poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -1,3 +1,11 @@
+From e37f7f6a0f1ef1b594574d11a8b90b8c861d047b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Sun, 15 Mar 2015 09:02:14 +0000
+Subject: [PATCH] mdadm: Fix build in x32 ABI
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
When try to print time_t values as a long int it causes an error because time_t
data type in x32 ABI is long long int.
@@ -5,11 +13,15 @@ Upstream-Status: Pending
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
-Index: mdadm-4.0/monitor.c
-===================================================================
---- mdadm-4.0.orig/monitor.c
-+++ mdadm-4.0/monitor.c
-@@ -445,9 +445,12 @@ static int read_and_act(struct active_ar
+---
+ monitor.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/monitor.c b/monitor.c
+index 81537ed..7c33382 100644
+--- a/monitor.c
++++ b/monitor.c
+@@ -445,9 +445,12 @@ static int read_and_act(struct active_array *a, fd_set *fds)
if (FD_ISSET(mdi->bb_fd, fds))
check_for_cleared_bb(a, mdi);
}
diff --git a/external/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/external/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
index 267c007c..8e2a8a90 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
+++ b/external/poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -1,4 +1,4 @@
-From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001
+From 911f6ea9be0c334885aeff66853b111cbd4066df Mon Sep 17 00:00:00 2001
From: "Maxin B. John" <maxin.john@intel.com>
Date: Wed, 10 Feb 2016 17:28:05 +0200
Subject: [PATCH] mdadm-fix-ptest-build-errors
@@ -16,15 +16,16 @@ builds fail with ptest enabled:
Upstream-Status: Pending
Signed-off-by: Maxin B. John <maxin.john@intel.com>
+
---
restripe.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/restripe.c b/restripe.c
-index 56dca73..d24b2b4 100644
+index 31b07e8..592ba5d 100644
--- a/restripe.c
+++ b/restripe.c
-@@ -842,10 +842,14 @@ int test_stripes(int *source, unsigned long long *offsets,
+@@ -864,10 +864,14 @@ int test_stripes(int *source, unsigned long long *offsets,
while (length > 0) {
int disk;
@@ -40,6 +41,3 @@ index 56dca73..d24b2b4 100644
}
for (i = 0 ; i < data_disks ; i++) {
int disk = geo_map(i, start/chunk_size, raid_disks,
---
-2.4.0
-
diff --git a/external/poky/meta/recipes-extended/mdadm/files/mdmonitor.service b/external/poky/meta/recipes-extended/mdadm/files/mdmonitor.service
deleted file mode 100644
index bd243b44..00000000
--- a/external/poky/meta/recipes-extended/mdadm/files/mdmonitor.service
+++ /dev/null
@@ -1,19 +0,0 @@
-# This file is part of mdadm.
-#
-# mdadm is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Software RAID monitoring and management
-ConditionPathExists=/etc/mdadm.conf
-
-[Service]
-Type=forking
-PIDFile=/var/run/mdadm/mdadm.pid
-EnvironmentFile=-/etc/sysconfig/mdmonitor
-ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid
-
-[Install]
-WantedBy=multi-user.target
diff --git a/external/poky/meta/recipes-extended/mdadm/files/run-ptest b/external/poky/meta/recipes-extended/mdadm/files/run-ptest
index 234f9737..fae8071d 100644
--- a/external/poky/meta/recipes-extended/mdadm/files/run-ptest
+++ b/external/poky/meta/recipes-extended/mdadm/files/run-ptest
@@ -1,19 +1,7 @@
#!/bin/sh
-LOG="$(pwd)/test.log"
+mkdir -p /mdadm-testing-dir
# make the test continue to execute even one fail
-./test --keep-going 2>&1|tee ${LOG}
-# translate the test report
-# "tests/18imsm-r10_4d-takeover-r0_2d... succeeded" -> "PASS: tests/18imsm-r10_4d-takeover-r0_2d"
-# "tests/19raid6repair... FAILED - see //log for details" -> "FAIL: tests/19raid6repair"
-sed -i -e '/succeeded/ s/^/PASS: /' -e '/FAILED/ s/^/FAIL: /' ${LOG}
-sed -i -e 's/... FAILED//g' -e 's/... succeeded//g' ${LOG}
-passed=`grep PASS: ${LOG}|wc -l`
-failed=`grep FAIL: ${LOG}|wc -l`
-all=$((passed + failed))
+dir=. ./test --keep-going --disable-integrity
-( echo "=== Test Summary ==="
- echo "TOTAL: ${all}"
- echo "PASSED: ${passed}"
- echo "FAILED: ${failed}"
-) | tee -a /${LOG}
+rm -rf /mdadm-testing-dir/*
diff --git a/external/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb b/external/poky/meta/recipes-extended/mdadm/mdadm_4.1.bb
index 8155ae41..001d3331 100644
--- a/external/poky/meta/recipes-extended/mdadm/mdadm_4.0.bb
+++ b/external/poky/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -9,31 +9,32 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
- file://gcc-4.9.patch \
+ file://run-ptest \
file://mdadm-3.3.2_x32_abi_time_t.patch \
file://mdadm-fix-ptest-build-errors.patch \
- file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
- file://run-ptest \
file://0001-mdadm.h-Undefine-dprintf-before-redefining.patch \
- file://0001-include-sys-sysmacros.h-for-major-minor-defintions.patch \
- file://0001-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch \
- file://0002-mdadm-Specify-enough-length-when-write-to-buffer.patch \
- file://0003-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch \
- file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \
- file://0005-Add-a-comment-to-indicate-valid-fallthrough.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-use-memmove-instead-of-memcpy-on-overlapping-region.patch \
- file://0001-Disable-gcc8-warnings.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://mdmonitor.service \
+ 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] = "2cb4feffea9167ba71b5f346a0c0a40d"
-SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9"
-CFLAGS += "-fno-strict-aliasing"
-inherit autotools-brokensep systemd
+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"
-EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
# 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
@@ -42,9 +43,12 @@ 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_unitdir}/system \
+ BINDIR="${base_sbindir}" UDEVDIR="${nonarch_base_libdir}/udev"'
+
+DEBUG_OPTIMIZATION_append = " -Wno-error"
+
do_compile() {
- # Point to right sbindir
- sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" ${S}/Makefile
oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
}
@@ -54,16 +58,15 @@ do_install() {
}
do_install_append() {
- install -d ${D}/${sysconfdir}/
- install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf
- install -d ${D}/${systemd_unitdir}/system
- install -m 644 ${S}/systemd/mdmonitor.service ${D}/${systemd_unitdir}/system
- install -d ${D}/${sysconfdir}/init.d
- install -m 755 ${WORKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor
+ 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
}
-SYSTEMD_SERVICE_${PN} = "mdmonitor.service"
-SYSTEMD_AUTO_ENABLE = "disable"
+do_install_append() {
+ oe_runmake install-systemd DESTDIR=${D}
+}
do_compile_ptest() {
oe_runmake test
@@ -72,7 +75,16 @@ do_compile_ptest() {
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!/!g' -i ${D}${PTEST_PATH}/test
+ 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
@@ -80,7 +92,7 @@ do_install_ptest() {
done
}
-RDEPENDS_${PN}-ptest += "bash"
+RDEPENDS_${PN}-ptest += "bash e2fsprogs-mke2fs"
RRECOMMENDS_${PN}-ptest += " \
coreutils \
util-linux \
@@ -91,3 +103,5 @@ RRECOMMENDS_${PN}-ptest += " \
kernel-module-raid10 \
kernel-module-raid456 \
"
+
+FILES_${PN} += "${systemd_unitdir}/*"