summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/mdadm/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/mdadm/files')
-rw-r--r--meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch30
-rw-r--r--meta/recipes-extended/mdadm/files/0001-Makefile-install-mdcheck.patch27
-rw-r--r--meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch155
-rw-r--r--meta/recipes-extended/mdadm/files/0002-Create.c-include-linux-falloc.h-for-FALLOC_FL_ZERO_R.patch27
-rw-r--r--meta/recipes-extended/mdadm/files/mdadm.init72
-rw-r--r--meta/recipes-extended/mdadm/files/run-ptest10
-rw-r--r--meta/recipes-extended/mdadm/files/xmalloc.patch32
7 files changed, 0 insertions, 353 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
deleted file mode 100644
index 8598aea1f1..0000000000
--- a/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From 232101e2fcc6359fb6db2bc232570e373e368c75 Mon Sep 17 00:00:00 2001
2From: "Maxin B. John" <maxin.john@intel.com>
3Date: Tue, 9 Feb 2016 11:44:01 +0200
4Subject: [PATCH] Fix the path of corosync and dlm header files check
5
6Original Makefile will check headers on host instead of sysroot.
7Fix it.
8
9Upstream-Status: Inappropriate [Yocto specific]
10
11Signed-off-by: Maxin B. John <maxin.john@intel.com>
12---
13 Makefile | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/Makefile b/Makefile
17index bcd092de..0a78cd22 100644
18--- a/Makefile
19+++ b/Makefile
20@@ -130,8 +130,8 @@ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
21 SYSTEMD_DIR=/lib/systemd/system
22 LIB_DIR=/usr/libexec/mdadm
23
24-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
25-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
26+COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] || echo -DNO_COROSYNC)
27+DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM)
28
29 DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
30 DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
diff --git a/meta/recipes-extended/mdadm/files/0001-Makefile-install-mdcheck.patch b/meta/recipes-extended/mdadm/files/0001-Makefile-install-mdcheck.patch
deleted file mode 100644
index bb4e8d0604..0000000000
--- a/meta/recipes-extended/mdadm/files/0001-Makefile-install-mdcheck.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From 407691e11037709af888ce2cf6bd5eac6971ac61 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 25 Jan 2022 16:25:01 +0800
4Subject: [PATCH] Makefile: install mdcheck
5
6The mdcheck_xxx.service files use mdcheck, but it's not installed.
7We need to install this script.
8
9Upstream-Status: Submitted [Sent patch to maintainer]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 Makefile | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/Makefile b/Makefile
17index 981e16fa..b28e7855 100644
18--- a/Makefile
19+++ b/Makefile
20@@ -345,6 +345,7 @@ install-systemd: systemd/mdmon@.service
21 install-bin: mdadm mdmon
22 $(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(BINDIR)/mdadm
23 $(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(BINDIR)/mdmon
24+ $(INSTALL) -D -m 755 misc/mdcheck $(DESTDIR)/usr/share/mdadm/mdcheck
25
26 uninstall:
27 rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
diff --git a/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch b/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch
deleted file mode 100644
index aa874dbec3..0000000000
--- a/meta/recipes-extended/mdadm/files/0001-restripe.c-Use-_FILE_OFFSET_BITS-to-enable-largefile.patch
+++ /dev/null
@@ -1,155 +0,0 @@
1From 9e3b15adf86147fe581cd2159cb99708abe26158 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 10 Nov 2022 12:31:22 -0800
4Subject: [PATCH] restripe.c: Use _FILE_OFFSET_BITS to enable largefile support
5
6Instead of using the lseek64 and friends, its better to enable it via
7the feature macro _FILE_OFFSET_BITS = 64 and let the C library deal with
8the width of types
9
10Upstream-Status: Submitted [https://lore.kernel.org/linux-raid/20221110225546.337164-1-raj.khem@gmail.com/]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 raid6check.c | 11 +++++++----
14 restripe.c | 13 ++++++++-----
15 swap_super.c | 13 +++++++------
16 3 files changed, 22 insertions(+), 15 deletions(-)
17
18diff --git a/raid6check.c b/raid6check.c
19index 99477761..8e7f1421 100644
20--- a/raid6check.c
21+++ b/raid6check.c
22@@ -22,6 +22,9 @@
23 * Based on "restripe.c" from "mdadm" codebase
24 */
25
26+/* Enable largefile support */
27+#define _FILE_OFFSET_BITS 64
28+
29 #include "mdadm.h"
30 #include <stdint.h>
31 #include <sys/mman.h>
32@@ -284,9 +287,9 @@ int manual_repair(int chunk_size, int syndrome_disks,
33 }
34
35 int write_res1, write_res2;
36- off64_t seek_res;
37+ off_t seek_res;
38
39- seek_res = lseek64(source[fd1],
40+ seek_res = lseek(source[fd1],
41 offsets[fd1] + start * chunk_size, SEEK_SET);
42 if (seek_res < 0) {
43 fprintf(stderr, "lseek failed for failed_disk1\n");
44@@ -294,7 +297,7 @@ int manual_repair(int chunk_size, int syndrome_disks,
45 }
46 write_res1 = write(source[fd1], blocks[failed_slot1], chunk_size);
47
48- seek_res = lseek64(source[fd2],
49+ seek_res = lseek(source[fd2],
50 offsets[fd2] + start * chunk_size, SEEK_SET);
51 if (seek_res < 0) {
52 fprintf(stderr, "lseek failed for failed_disk2\n");
53@@ -379,7 +382,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets,
54 goto exitCheck;
55 }
56 for (i = 0 ; i < raid_disks ; i++) {
57- off64_t seek_res = lseek64(source[i], offsets[i] + start * chunk_size,
58+ off_t seek_res = lseek(source[i], offsets[i] + start * chunk_size,
59 SEEK_SET);
60 if (seek_res < 0) {
61 fprintf(stderr, "lseek to source %d failed\n", i);
62diff --git a/restripe.c b/restripe.c
63index 5e126eb7..af76c634 100644
64--- a/restripe.c
65+++ b/restripe.c
66@@ -22,6 +22,9 @@
67 * Email: <neilb@suse.de>
68 */
69
70+/* Enable largefile support */
71+#define _FILE_OFFSET_BITS 64
72+
73 #include "mdadm.h"
74 #include "xmalloc.h"
75
76@@ -583,7 +586,7 @@ int save_stripes(int *source, unsigned long long *offsets,
77 raid_disks, level, layout);
78 if (dnum < 0) abort();
79 if (source[dnum] < 0 ||
80- lseek64(source[dnum],
81+ lseek(source[dnum],
82 offsets[dnum] + offset, 0) < 0 ||
83 read(source[dnum], buf+disk * chunk_size,
84 chunk_size) != chunk_size) {
85@@ -756,8 +759,8 @@ int restore_stripes(int *dest, unsigned long long *offsets,
86 raid_disks, level, layout);
87 if (src_buf == NULL) {
88 /* read from file */
89- if (lseek64(source, read_offset, 0) !=
90- (off64_t)read_offset) {
91+ if (lseek(source, read_offset, 0) !=
92+ (off_t)read_offset) {
93 rv = -1;
94 goto abort;
95 }
96@@ -818,7 +821,7 @@ int restore_stripes(int *dest, unsigned long long *offsets,
97 }
98 for (i=0; i < raid_disks ; i++)
99 if (dest[i] >= 0) {
100- if (lseek64(dest[i],
101+ if (lseek(dest[i],
102 offsets[i]+offset, 0) < 0) {
103 rv = -1;
104 goto abort;
105@@ -868,7 +871,7 @@ int test_stripes(int *source, unsigned long long *offsets,
106 int disk;
107
108 for (i = 0 ; i < raid_disks ; i++) {
109- if ((lseek64(source[i], offsets[i]+start, 0) < 0) ||
110+ if ((lseek(source[i], offsets[i]+start, 0) < 0) ||
111 (read(source[i], stripes[i], chunk_size) !=
112 chunk_size)) {
113 free(q);
114diff --git a/swap_super.c b/swap_super.c
115index b6db5743..18c89e2b 100644
116--- a/swap_super.c
117+++ b/swap_super.c
118@@ -1,3 +1,6 @@
119+/* Enable largefile support */
120+#define _FILE_OFFSET_BITS 64
121+
122 #include <unistd.h>
123 #include <stdlib.h>
124 #include <fcntl.h>
125@@ -16,8 +19,6 @@
126
127 #define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
128
129-extern long long lseek64(int, long long, int);
130-
131 int main(int argc, char *argv[])
132 {
133 int fd, i;
134@@ -38,8 +39,8 @@ int main(int argc, char *argv[])
135 exit(1);
136 }
137 offset = MD_NEW_SIZE_SECTORS(size) * 512LL;
138- if (lseek64(fd, offset, 0) < 0LL) {
139- perror("lseek64");
140+ if (lseek(fd, offset, 0) < 0LL) {
141+ perror("lseek");
142 exit(1);
143 }
144 if (read(fd, super, 4096) != 4096) {
145@@ -68,8 +69,8 @@ int main(int argc, char *argv[])
146 super[32*4+10*4 +i] = t;
147 }
148
149- if (lseek64(fd, offset, 0) < 0LL) {
150- perror("lseek64");
151+ if (lseek(fd, offset, 0) < 0LL) {
152+ perror("lseek");
153 exit(1);
154 }
155 if (write(fd, super, 4096) != 4096) {
diff --git a/meta/recipes-extended/mdadm/files/0002-Create.c-include-linux-falloc.h-for-FALLOC_FL_ZERO_R.patch b/meta/recipes-extended/mdadm/files/0002-Create.c-include-linux-falloc.h-for-FALLOC_FL_ZERO_R.patch
deleted file mode 100644
index e425fc446e..0000000000
--- a/meta/recipes-extended/mdadm/files/0002-Create.c-include-linux-falloc.h-for-FALLOC_FL_ZERO_R.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1From 8de073c637a1ea968b7304f373a20b13a4a47bbc Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 12 Mar 2024 10:54:08 +0100
4Subject: [PATCH] Create.c: include linux/falloc.h for FALLOC_FL_ZERO_RANGE
5 definition
6
7glibc provides this through fcntl.h but musl does not - should
8be reported and fixed there.
9
10Upstream-Status: Inappropriate [musl-specific issue]
11Signed-off-by: Alexander Kanavin <alex@linutronix.de>
12---
13 Create.c | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/Create.c b/Create.c
17index fd6c9215..3210a03e 100644
18--- a/Create.c
19+++ b/Create.c
20@@ -33,6 +33,7 @@
21 #include <signal.h>
22 #include <sys/signalfd.h>
23 #include <sys/wait.h>
24+#include <linux/falloc.h>
25
26 #ifndef FALLOC_FL_ZERO_RANGE
27 #define FALLOC_FL_ZERO_RANGE 16
diff --git a/meta/recipes-extended/mdadm/files/mdadm.init b/meta/recipes-extended/mdadm/files/mdadm.init
deleted file mode 100644
index cab91b9acc..0000000000
--- a/meta/recipes-extended/mdadm/files/mdadm.init
+++ /dev/null
@@ -1,72 +0,0 @@
1#!/bin/sh
2#
3# Start the MD monitor daemon for all active MD arrays if desired.
4#
5### BEGIN INIT INFO
6# Provides: mdadm
7# Required-Start: $local_fs $syslog mdadm-raid
8# Required-Stop: $local_fs $syslog mdadm-raid
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: MD monitoring daemon
12# Description: mdadm provides a monitor mode, in which it will scan for
13# problems with the MD devices. If a problem is found, the
14# administrator is alerted via email, or a custom script is
15# run.
16### END INIT INFO
17#
18
19MDADM=/sbin/mdadm
20RUNDIR=/var/run/mdadm
21PIDFILE=$RUNDIR/monitor.pid
22DEBIANCONFIG=/etc/default/mdadm
23
24test -x "$MDADM" || exit 0
25
26test -f /proc/mdstat || exit 0
27
28START_DAEMON=true
29test -f $DEBIANCONFIG && . $DEBIANCONFIG
30
31. /lib/lsb/init-functions
32
33# Include functions
34. /etc/init.d/functions
35
36case "${1:-}" in
37 start)
38 if is_true $START_DAEMON; then
39 log_daemon_msg "Starting MD monitoring service" "mdadm --monitor"
40 mkdir -p $RUNDIR
41 start-stop-daemon -S -p $PIDFILE -x $MDADM -- \
42 --monitor --pid-file $PIDFILE --daemonise --scan ${DAEMON_OPTIONS:-}
43 RETVAL=$?
44 log_end_msg $RETVAL
45 exit $RETVAL
46 fi
47 ;;
48 stop)
49 if [ -f $PIDFILE ] ; then
50 log_daemon_msg "Stopping MD monitoring service" "mdadm --monitor"
51 start-stop-daemon -K -p $PIDFILE -x $MDADM
52 RETVAL=$?
53 rm -f $PIDFILE
54 log_end_msg $RETVAL
55 exit $RETVAL
56 fi
57 ;;
58 status)
59 status -p $PIDFILE "$MDADM" && exit 0 || exit $?
60 ;;
61 restart|reload|force-reload)
62 ${0:-} stop
63 ${0:-} start
64 ;;
65 *)
66 echo "Usage: ${0:-} {start|stop|status|restart|reload|force-reload}" >&2
67 exit 1
68 ;;
69esac
70
71exit 0
72
diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
deleted file mode 100644
index c3f201491e..0000000000
--- a/meta/recipes-extended/mdadm/files/run-ptest
+++ /dev/null
@@ -1,10 +0,0 @@
1#!/bin/sh
2
3logdir=$PWD/logs
4targetdir=/mdadm-testing-dir
5
6rm -rf $targetdir $logdir
7mkdir -p $targetdir $logdir
8
9# make the test continue to execute even one fail
10./test --keep-going --disable-integrity --skip-broken --save-logs --logdir=$logdir
diff --git a/meta/recipes-extended/mdadm/files/xmalloc.patch b/meta/recipes-extended/mdadm/files/xmalloc.patch
deleted file mode 100644
index 61774721d0..0000000000
--- a/meta/recipes-extended/mdadm/files/xmalloc.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From c5cf5a83be4e3ce04ebf3250f77aeb465eeb53a1 Mon Sep 17 00:00:00 2001
2From: Xiao Ni <xni@redhat.com>
3Date: Fri, 17 Jan 2025 15:15:40 +0800
4Subject: [PATCH] mdadm/raid6check: add xmalloc.h to raid6check.c
5
6It reports building error:
7raid6check.c:324:26: error: implicit declaration of function xmalloc
8
9Add xmalloc.h to raid6check.c file to fix this.
10
11Signed-off-by: Xiao Ni <xni@redhat.com>
12Link: https://lore.kernel.org/r/20250117071540.4094-1-xni@redhat.com
13Signed-off-by: Song Liu <song@kernel.org>
14
15Upstream-Status: Backport [https://web.git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?h=main&id=e0df6c4c984d564e9e40913727e916a6cd8f466e]
16Signed-off-by: Alexander Kanavin <alex@linutronix.de>
17---
18 raid6check.c | 1 +
19 1 file changed, 1 insertion(+)
20
21diff --git a/raid6check.c b/raid6check.c
22index 8e7f1421..486b10c6 100644
23--- a/raid6check.c
24+++ b/raid6check.c
25@@ -26,6 +26,7 @@
26 #define _FILE_OFFSET_BITS 64
27
28 #include "mdadm.h"
29+#include "xmalloc.h"
30 #include <stdint.h>
31 #include <sys/mman.h>
32