mdadm: update to 4.3
authorRosen Penev <rosenp@gmail.com>
Sat, 18 May 2024 00:28:29 +0000 (17:28 -0700)
committerRISCi_ATOM <bob@bobcall.me>
Wed, 12 Jun 2024 16:25:07 +0000 (12:25 -0400)
Backport three patches, add one for GCC14, and add Alpine time_t patch for
musl.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
package/utils/mdadm/Makefile
package/utils/mdadm/patches/010-falloc.patch [new file with mode: 0644]
package/utils/mdadm/patches/020-basename.patch [new file with mode: 0644]
package/utils/mdadm/patches/030-fix-monitor-tv_sec.patch [new file with mode: 0644]
package/utils/mdadm/patches/040-udev.patch [new file with mode: 0644]
package/utils/mdadm/patches/050-pie.patch [new file with mode: 0644]
package/utils/mdadm/patches/100-cross_compile.patch
package/utils/mdadm/patches/200-reduce_size.patch

index 8070003394f80db91476047cef098c768e28dd70..c2778fe351cb3ae3ac88ee5b39893d763cca0f68 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mdadm
-PKG_VERSION:=4.2
-PKG_RELEASE:=2
+PKG_VERSION:=4.3
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm
-PKG_HASH:=461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d
+PKG_HASH:=416727ae1f1080ea6e3090cea36dd076826fc369151e36ab736557ba92196f9f
 
 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 PKG_CPE_ID:=cpe:/a:mdadm_project:mdadm
diff --git a/package/utils/mdadm/patches/010-falloc.patch b/package/utils/mdadm/patches/010-falloc.patch
new file mode 100644 (file)
index 0000000..2f2a9b8
--- /dev/null
@@ -0,0 +1,36 @@
+From 52bead95d2957437c691891fcdc49bd6afccdd49 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 12 Apr 2024 18:45:13 +0200
+Subject: Create.c: fix uclibc build
+
+Define FALLOC_FL_ZERO_RANGE if needed as FALLOC_FL_ZERO_RANGE is only
+defined for aarch64 on uclibc-ng resulting in the following or1k build
+failure since commit 577fd10486d8d1472a6b559066f344ac30a3a391:
+
+Create.c: In function 'write_zeroes_fork':
+Create.c:155:35: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
+  155 |                 if (fallocate(fd, FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE,
+      |                                   ^~~~~~~~~~~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/0e04bcdb591ca5642053e1f7e31384f06581e989
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+---
+ Create.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/Create.c
++++ b/Create.c
+@@ -32,6 +32,10 @@
+ #include      <sys/signalfd.h>
+ #include      <sys/wait.h>
++#ifndef FALLOC_FL_ZERO_RANGE
++#define FALLOC_FL_ZERO_RANGE 16
++#endif
++
+ static int round_size_and_verify(unsigned long long *size, int chunk)
+ {
+       if (*size == 0)
diff --git a/package/utils/mdadm/patches/020-basename.patch b/package/utils/mdadm/patches/020-basename.patch
new file mode 100644 (file)
index 0000000..d4f7aa5
--- /dev/null
@@ -0,0 +1,30 @@
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -27,6 +27,7 @@
+ #include      "md_p.h"
+ #include      "md_u.h"
+ #include      <sys/wait.h>
++#include      <libgen.h>
+ #include      <limits.h>
+ #include      <syslog.h>
+--- a/platform-intel.c
++++ b/platform-intel.c
+@@ -28,6 +28,7 @@
+ #include <sys/mman.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <libgen.h>
+ #include <limits.h>
+ #define NVME_SUBSYS_PATH "/sys/devices/virtual/nvme-subsystem/"
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -27,6 +27,7 @@
+ #include <scsi/sg.h>
+ #include <ctype.h>
+ #include <dirent.h>
++#include <libgen.h>
+ /* MPB == Metadata Parameter Block */
+ #define MPB_SIGNATURE "Intel Raid ISM Cfg Sig. "
diff --git a/package/utils/mdadm/patches/030-fix-monitor-tv_sec.patch b/package/utils/mdadm/patches/030-fix-monitor-tv_sec.patch
new file mode 100644 (file)
index 0000000..a0fe9fd
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/monitor.c
++++ b/monitor.c
+@@ -449,9 +449,9 @@ static int read_and_act(struct active_ar
+       }
+       gettimeofday(&tv, NULL);
+-      dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
++      dprintf("(%d): %lld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
+               a->info.container_member,
+-              tv.tv_sec, tv.tv_usec,
++              (long long)tv.tv_sec, (long)tv.tv_usec,
+               array_states[a->curr_state],
+               array_states[a->prev_state],
+               sync_actions[a->curr_action],
diff --git a/package/utils/mdadm/patches/040-udev.patch b/package/utils/mdadm/patches/040-udev.patch
new file mode 100644 (file)
index 0000000..0d497aa
--- /dev/null
@@ -0,0 +1,26 @@
+From 1750758c7ff526e3560433f6235e5cfa35cf646a Mon Sep 17 00:00:00 2001
+From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+Date: Wed, 6 Mar 2024 15:50:55 +0100
+Subject: udev.c: Do not require libudev.h if DNO_LIBUDEV
+
+libudev may not be presented at all, do not require it.
+
+Reported-by: Boian Bonev <bbonev@ipacct.com>
+Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+---
+ udev.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/udev.c
++++ b/udev.c
+@@ -26,7 +26,10 @@
+ #include      <signal.h>
+ #include      <limits.h>
+ #include      <syslog.h>
++
++#ifndef NO_LIBUDEV
+ #include      <libudev.h>
++#endif
+ static char *unblock_path;
diff --git a/package/utils/mdadm/patches/050-pie.patch b/package/utils/mdadm/patches/050-pie.patch
new file mode 100644 (file)
index 0000000..59c96f5
--- /dev/null
@@ -0,0 +1,33 @@
+From 893a55831e5abbcd15b171db66fa1f389fb61506 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 7 May 2024 19:32:16 +0200
+Subject: Makefile: Move -pie to LDFLAGS
+
+Move -pie from LDLIBS to LDFLAGS and make LDFLAGS configurable to allow
+the user to drop it by setting their own LDFLAGS (e.g. PIE could be
+enabled or disabled by the buildsystem such as buildroot).
+
+Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -132,12 +132,12 @@ CFLAGS += -DUSE_PTHREADS
+ MON_LDFLAGS += -pthread
+ endif
+-LDFLAGS = -Wl,-z,now,-z,noexecstack
++LDFLAGS ?= -pie -Wl,-z,now,-z,noexecstack
+ # If you want a static binary, you might uncomment these
+ # LDFLAGS += -static
+ # STRIP = -s
+-LDLIBS = -ldl -pie
++LDLIBS = -ldl
+ # To explicitly disable libudev, set -DNO_LIBUDEV in CXFLAGS
+ ifeq (, $(findstring -DNO_LIBUDEV,  $(CXFLAGS)))
index 790d7755b08a52b748799d3a3f77c6fee4202369..bd71c083e598d891f608ff0bb7968173757e72b0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -99,7 +99,7 @@ DLM:=$(shell [ -f /usr/include/libdlm.h
+@@ -115,7 +115,7 @@ DLM:=$(shell [ -f /usr/include/libdlm.h
  DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
  DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
  DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\"
index 163e125c22dd6e985426e7799961f1755dc7d7cb..d14fae716e22674365a8f928c578c210c181539c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Incremental.c
 +++ b/Incremental.c
-@@ -983,6 +983,10 @@ static int array_try_spare(char *devname
+@@ -985,6 +985,10 @@ static int array_try_spare(char *devname
                                goto next;
                }
  
@@ -13,7 +13,7 @@
                        /* domain test fails */
 --- a/util.c
 +++ b/util.c
-@@ -1147,7 +1147,9 @@ void wait_for(char *dev, int fd)
+@@ -1192,7 +1192,9 @@ void wait_for(char *dev, int fd)
  struct superswitch *superlist[] =
  {
        &super0, &super1,