[OE-core] [PATCH v3] mdadm: 3.3.2 -> 3.3.3

Li xin lixin.fnst at cn.fujitsu.com
Thu Jul 30 06:50:38 UTC 2015


Upgrade mdadm from 3.3.2 to 3.3.3

1) Remove backported patch:inline.patch

2) update context of mdadm-3.3.2_x32_abi_time_t.patch

3) Add systemd support:
add systemd service file mdmonitor.service and install conf example file.

Signed-off-by: Li Xin <lixin.fnst at cn.fujitsu.com>
---
 meta/recipes-extended/mdadm/files/inline.patch     | 39 ----------------------
 .../mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch   | 26 +++++++++------
 .../mdadm/{mdadm_3.3.2.bb => mdadm_3.3.3.bb}       | 28 ++++++++++++----
 3 files changed, 37 insertions(+), 56 deletions(-)
 delete mode 100644 meta/recipes-extended/mdadm/files/inline.patch
 rename meta/recipes-extended/mdadm/{mdadm_3.3.2.bb => mdadm_3.3.3.bb} (66%)

diff --git a/meta/recipes-extended/mdadm/files/inline.patch b/meta/recipes-extended/mdadm/files/inline.patch
deleted file mode 100644
index 9009f06..0000000
--- a/meta/recipes-extended/mdadm/files/inline.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-with gnu11 turning on a default with gcc-5 we have to abide by new inline semantics
-using 'inline' and using is in same translation unit means an external definition has to exist
-same like "external inline" in gnu89, we simply make the functions static inline since they
-are just meant to be used in this file
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <raj.khem at gmail.com>
-
-Index: mdadm-3.3.2/bitmap.c
-===================================================================
---- mdadm-3.3.2.orig/bitmap.c
-+++ mdadm-3.3.2/bitmap.c
-@@ -20,7 +20,7 @@
- 
- #include "mdadm.h"
- 
--inline void sb_le_to_cpu(bitmap_super_t *sb)
-+static inline void sb_le_to_cpu(bitmap_super_t *sb)
- {
- 	sb->magic = __le32_to_cpu(sb->magic);
- 	sb->version = __le32_to_cpu(sb->version);
-@@ -34,7 +34,7 @@ inline void sb_le_to_cpu(bitmap_super_t
- 	sb->write_behind = __le32_to_cpu(sb->write_behind);
- }
- 
--inline void sb_cpu_to_le(bitmap_super_t *sb)
-+static inline void sb_cpu_to_le(bitmap_super_t *sb)
- {
- 	sb_le_to_cpu(sb); /* these are really the same thing */
- }
-@@ -74,7 +74,7 @@ typedef struct bitmap_info_s {
- } bitmap_info_t;
- 
- /* count the dirty bits in the first num_bits of byte */
--inline int count_dirty_bits_byte(char byte, int num_bits)
-+static inline int count_dirty_bits_byte(char byte, int num_bits)
- {
- 	int num = 0;
- 
diff --git a/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
index 143a8d9..99e5ed4 100644
--- a/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
+++ b/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -1,26 +1,32 @@
-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.
+From 72ea9bc213c0fcbc3a11bad6478645a68692af38 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst at cn.fujitsu.com>
+Date: Mon, 27 Jul 2015 00:27:12 +0900
+Subject: [PATCH] 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 at linux.intel.com>
+Signed-off-by: Li Xin <lixin.fnst at cn.fujitsu.com>
+---
+ monitor.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
 diff --git a/monitor.c b/monitor.c
-index f81e707..19ea041 100644
+index 870cc1a..068aab4 100644
 --- a/monitor.c
 +++ b/monitor.c
-@@ -260,8 +260,13 @@ static int read_and_act(struct active_array *a)
+@@ -259,7 +259,11 @@ static int read_and_act(struct active_array *a)
  	}
  
  	gettimeofday(&tv, NULL);
 +#if defined(__x86_64__) && defined(__ILP32__)
 +	dprintf("%s(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
 +#else
- 	dprintf("%s(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
--		__func__, a->info.container_member,
+ 	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
 +#endif
-+		__func__,
-+		a->info.container_member,
+ 		a->info.container_member,
  		tv.tv_sec, tv.tv_usec,
  		array_states[a->curr_state],
- 		array_states[a->prev_state],
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.2.bb b/meta/recipes-extended/mdadm/mdadm_3.3.3.bb
similarity index 66%
rename from meta/recipes-extended/mdadm/mdadm_3.3.2.bb
rename to meta/recipes-extended/mdadm/mdadm_3.3.3.bb
index b2fbe4a..5600bd9 100644
--- a/meta/recipes-extended/mdadm/mdadm_3.3.2.bb
+++ b/meta/recipes-extended/mdadm/mdadm_3.3.3.bb
@@ -10,18 +10,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://mdadm-3.2.2_fix_for_x32.patch \
-           file://gcc-4.9.patch \
            file://mdadm-3.3.2_x32_abi_time_t.patch \
-           file://inline.patch \
+           file://gcc-4.9.patch \
            file://run-ptest \
+           file://mdmonitor.service \
 	  "
-
-SRC_URI[md5sum] = "44698d351501cac6a89072dc877eb220"
-SRC_URI[sha256sum] = "0f3a7e1a76b13892b79f9fceaf99ecb23513260389a768ac644ffa3ae06e5b8c"
+SRC_URI[md5sum] = "dabd5ce70f3fff340cad7c18e4a062ab"
+SRC_URI[sha256sum] = "f5b50a6b506697fb9968d660444447473b453f9eaefaa9b7d31c184693b8a28c"
 
 CFLAGS += "-fno-strict-aliasing"
 
-inherit autotools-brokensep
+inherit autotools-brokensep systemd
 
 EXTRA_OEMAKE = "CHECK_RUN_DIR=0"
 # PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
@@ -41,7 +40,22 @@ do_install() {
 	autotools_do_install
 }
 
-FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
+do_install_append() {
+        install -d ${D}/${sysconfdir}/
+        install -m 644 ${S}/mdadm.conf-example ${D}${sysconfdir}/
+        install -d ${D}/${systemd_unitdir}/system
+        install -m 644 ${WORKDIR}/mdmonitor.service ${D}/${systemd_unitdir}/system
+        sed -i -e 's, at basesbindir@,${base_sbindir},g' \
+                -e 's, at localstatedir@,${localstatedir},g' \
+                -e 's, at sysconfdir@,${sysconfdir},g' \
+                ${D}/${systemd_unitdir}/system/mdmonitor.service
+        install -d ${D}/${localstatedir}
+        install -d ${D}/${localstatedir}/run
+        install -d -m 700 ${D}/${localstatedir}/run/mdadm
+}
+FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules \
+                /run/mdadm \
+                ${systemd_unitdir}"
 
 inherit ptest
 
-- 
1.8.4.2




More information about the Openembedded-core mailing list