summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-extended/mdadm/files
diff options
context:
space:
mode:
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-extended/mdadm/files')
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest10
10 files changed, 394 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
new file mode 100644
index 000000000..ee482b5ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
@@ -0,0 +1,50 @@
+From 835baf02fd42012bbc0603dffb1f80c6ecf0fb9e Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Mon, 8 Feb 2016 11:18:52 +0200
+Subject: [PATCH] Fix some type comparison problems
+
+As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
+timestamps will overflow in the year 2038. It already changed the
+utime and ctime in struct mdu_array_info_s from int to unsigned
+int. So we need to change the values that compared with them to
+unsigned int too.
+
+Upstream-Status: Backport
+
+Signed-off-by : Xiao Ni <xni@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+
+ Monitor.c | 2 +-
+ util.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Monitor.c b/Monitor.c
+index f19c2e5..6df80f9 100644
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -33,7 +33,7 @@
+ struct state {
+ char *devname;
+ char devnm[32]; /* to sync with mdstat info */
+- long utime;
++ unsigned int utime;
+ int err;
+ char *spare_group;
+ int active, working, failed, spare, raid;
+diff --git a/util.c b/util.c
+index 3e6d293..96a806d 100644
+--- a/util.c
++++ b/util.c
+@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
+ */
+ struct superswitch *ss;
+ struct supertype *st;
+- time_t besttime = 0;
++ unsigned int besttime = 0;
+ int bestsuper = -1;
+ int i;
+
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
new file mode 100644
index 000000000..deb748638
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -0,0 +1,33 @@
+From 1f5baf3ad95ae4c39efe4d8ad8b2e642b3a351da 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
+
+Original Makefile will check headers on host instead of sysroot.
+Fix it.
+
+Upstream-Status: Inappropriate [Yocto specific]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index fd79cfb..34150a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -80,8 +80,8 @@ MDMON_DIR = $(RUN_DIR)
+ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
+ SYSTEMD_DIR=/lib/systemd/system
+
+-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
+-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
++COROSYNC:=$(shell [ -d $(SYSROOT)/usr/include/corosync ] || echo -DNO_COROSYNC)
++DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM)
+
+ DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
+ DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
new file mode 100644
index 000000000..df70b1cf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
@@ -0,0 +1,86 @@
+From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 08:17:42 +0000
+Subject: [PATCH] Fix typo in comparision
+
+error: comparison of array 'devnm' equal to a null pointer is always false
+
+User bitwise '&' operator as it is a mask
+
+Fixes
+error: use of logical '&&' with constant operand
+
+Remove extraneous parens
+
+error: equality comparison with extraneous parentheses
+
+Remove dead code
+
+restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdmon.h | 2 +-
+ mdopen.c | 2 +-
+ restripe.c | 3 ---
+ super-intel.c | 2 +-
+ 4 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/mdmon.h b/mdmon.h
+index aa750c6..0b08c3d 100644
+--- a/mdmon.h
++++ b/mdmon.h
+@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
+ break;
+ case 10:
+ l = array->array.layout;
+- ncopies = (l & 0xff) * ((l >> 8) && 0xff);
++ ncopies = (l & 0xff) * ((l >> 8) & 0xff);
+ sync_size = array->component_size * array->array.raid_disks;
+ sync_size /= ncopies;
+ break;
+diff --git a/mdopen.c b/mdopen.c
+index 28410f4..c5ee2a6 100644
+--- a/mdopen.c
++++ b/mdopen.c
+@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
+ else if (num < 0) {
+ /* need to choose a free number. */
+ char *_devnm = find_free_devnm(use_mdp);
+- if (devnm == NULL) {
++ if (_devnm == NULL) {
+ pr_err("No avail md devices - aborting\n");
+ return -1;
+ }
+diff --git a/restripe.c b/restripe.c
+index 4d92190..cfe9666 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
+ curr_broken_disk = diskD;
+ }
+
+- if((Px == 0) && (Qx == 0))
+- curr_broken_disk = curr_broken_disk;
+-
+ if(curr_broken_disk >= data_disks + 2)
+ broken_status = 2;
+
+diff --git a/super-intel.c b/super-intel.c
+index 3f812d6..1838012 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
+ geo->size = max_size;
+ }
+
+- if ((direction == ROLLBACK_METADATA_CHANGES)) {
++ if (direction == ROLLBACK_METADATA_CHANGES) {
+ /* accept size for rollback only
+ */
+ } else {
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
new file mode 100644
index 000000000..139547398
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
@@ -0,0 +1,55 @@
+From cf14a9987ea1040457ce53bc2ab7d096818cb780 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 18:06:32 +0200
+Subject: [PATCH] mdadm.h: bswap is already defined in uclibc
+
+Fixes this build error:
+
+| In file included from mdadm.c:28:0:
+| mdadm.h:142:0: error: "bswap_16" redefined [-Werror]
+| #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+| ^
+
+Upstream-Status: Submitted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ mdadm.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index dd02be7..230e60f 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -139,12 +139,20 @@ struct dlm_lksb {
+ * and there is no standard conversion function so... */
+ /* And dietlibc doesn't think byteswap is ok, so.. */
+ /* #include <byteswap.h> */
++
++#ifndef bswap_16
+ #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+ ((x) & 0xff00U) >> 8)
++#endif
++
++#ifndef bswap_32
+ #define bswap_32(x) (((x) & 0x000000ffU) << 24 | \
+ ((x) & 0xff000000U) >> 24 | \
+ ((x) & 0x0000ff00U) << 8 | \
+ ((x) & 0x00ff0000U) >> 8)
++#endif
++
++#ifndef bswap_64
+ #define bswap_64(x) (((x) & 0x00000000000000ffULL) << 56 | \
+ ((x) & 0xff00000000000000ULL) >> 56 | \
+ ((x) & 0x000000000000ff00ULL) << 40 | \
+@@ -153,6 +161,7 @@ struct dlm_lksb {
+ ((x) & 0x0000ff0000000000ULL) >> 24 | \
+ ((x) & 0x00000000ff000000ULL) << 8 | \
+ ((x) & 0x000000ff00000000ULL) >> 8)
++#endif
+
+ #if !defined(__KLIBC__)
+ #if BYTE_ORDER == LITTLE_ENDIAN
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
new file mode 100644
index 000000000..d5cf00374
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
@@ -0,0 +1,45 @@
+From 2645673a7ea948a1297d5b8f0daab29b898f044f Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 17:14:04 +0200
+Subject: [PATCH] util.c: include poll.h instead of sys/poll.h
+
+This fixes a compile warning when building with musl:
+
+ In file included from util.c:27:0:
+ |
+ qemux86-64/usr/include/sys/poll.h:1:2:
+ error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ [-Werror=cpp]
+ | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ | ^
+
+Upstream-Status: Accepted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 970d484..3e6d293 100644
+--- a/util.c
++++ b/util.c
+@@ -24,7 +24,6 @@
+
+ #include "mdadm.h"
+ #include "md_p.h"
+-#include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
+@@ -32,6 +31,7 @@
+ #include <sys/resource.h>
+ #include <sys/vfs.h>
+ #include <linux/magic.h>
++#include <poll.h>
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <signal.h>
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
new file mode 100644
index 000000000..54bf1d79a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
@@ -0,0 +1,22 @@
+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-3.3/super-intel.c
+===================================================================
+--- mdadm-3.3.orig/super-intel.c 2014-05-02 15:08:21.154319651 -0700
++++ mdadm-3.3/super-intel.c 2014-05-02 15:09:31.470985794 -0700
+@@ -5060,7 +5060,7 @@
+ 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/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
new file mode 100644
index 000000000..40acc148e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Accepted
+
+By hardcoding CC's definition in the Makefile, all the gcc parameters
+set by tune settings are lost. Causing compile failure with x32 toolchain
+
+As the bitbake defined CC is good, there is no need to redfine CC in the
+make file, hence making the CC definition in the Makefile conditional.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: mdadm-3.3/Makefile
+===================================================================
+--- mdadm-3.3.orig/Makefile 2013-09-03 07:47:47.000000000 +0300
++++ mdadm-3.3/Makefile 2013-10-16 16:44:23.542295487 +0300
+@@ -41,7 +41,7 @@
+
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+
+-CC = $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
new file mode 100644
index 000000000..c656d073e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -0,0 +1,25 @@
+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.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Index: mdadm-3.3.4/monitor.c
+===================================================================
+--- mdadm-3.3.4.orig/monitor.c
++++ mdadm-3.3.4/monitor.c
+@@ -257,9 +257,12 @@ static int read_and_act(struct active_ar
+ mdi->curr_state = read_dev_state(mdi->state_fd);
+ }
+ }
+-
+ gettimeofday(&tv, NULL);
++#if defined(__x86_64__) && defined(__ILP32__)
++ dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#else
+ dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#endif
+ a->info.container_member,
+ tv.tv_sec, tv.tv_usec,
+ array_states[a->curr_state],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
new file mode 100644
index 000000000..267c007c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -0,0 +1,45 @@
+From c65898b9da82df94e1bae7937e415a7eb80355d5 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
+
+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 <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
+--- a/restripe.c
++++ b/restripe.c
+@@ -842,10 +842,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,
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644
index 000000000..5b276090f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test &>./test.log
+if [ $? -eq 0 ]
+then
+ echo "PASS: mdadm"
+ rm test.log
+else
+ echo "FAIL: mdadm"
+fi
OpenPOWER on IntegriCloud