From d720f83f87cebc55116ce9aebe5bcbe7d21a49d3 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 3 Aug 2019 11:27:55 +0200 Subject: [PATCH] mdadm: Fix compile with musl 1.1.23 This adds missing includes for sys/sysmacros.h which are needed with musl libc 1.1.23. Signed-off-by: Hauke Mehrtens (cherry picked from commit ba8aeb02eae26771b89390403462e6841621069e) --- .../mdadm/patches/100-cross_compile.patch | 2 +- ...missing-include-file-sys-sysmacros.h.patch | 222 ++++++++++++++++++ .../utils/mdadm/patches/200-reduce_size.patch | 4 +- 3 files changed, 225 insertions(+), 3 deletions(-) create mode 100644 package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch diff --git a/package/utils/mdadm/patches/100-cross_compile.patch b/package/utils/mdadm/patches/100-cross_compile.patch index 3576364d6f..0a5fa017c6 100644 --- a/package/utils/mdadm/patches/100-cross_compile.patch +++ b/package/utils/mdadm/patches/100-cross_compile.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -97,7 +97,7 @@ DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM) +@@ -97,7 +97,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)\" diff --git a/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch b/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch new file mode 100644 index 0000000000..3bb5f9af06 --- /dev/null +++ b/package/utils/mdadm/patches/102-Add-missing-include-file-sys-sysmacros.h.patch @@ -0,0 +1,222 @@ +From 1ee119c8026dff34a4d8c4269c05d3d4e0c25aa6 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sat, 3 Aug 2019 11:03:40 +0200 +Subject: [mdadm PATCH] Add missing include file sys/sysmacros.h + +This include file is needed for makedev(), major() and minor() which are +used in these functions. In musl 1.1.23 sys/sysmacros.h is not included +indirectly any more and mdadm fails to compile. + +Signed-off-by: Hauke Mehrtens +--- + Assemble.c | 1 + + Build.c | 1 + + Create.c | 1 + + Detail.c | 1 + + Grow.c | 1 + + Incremental.c | 1 + + Manage.c | 1 + + Monitor.c | 1 + + Query.c | 1 + + lib.c | 1 + + mapfile.c | 1 + + mdadm.c | 1 + + mdopen.c | 1 + + platform-intel.c | 1 + + policy.c | 1 + + super-ddf.c | 1 + + super-intel.c | 1 + + sysfs.c | 1 + + util.c | 1 + + 19 files changed, 19 insertions(+) + +--- a/Assemble.c ++++ b/Assemble.c +@@ -24,6 +24,7 @@ + + #include "mdadm.h" + #include ++#include + + static int name_matches(char *found, char *required, char *homehost, int require_homehost) + { +--- a/Build.c ++++ b/Build.c +@@ -23,6 +23,7 @@ + */ + + #include "mdadm.h" ++#include + + int Build(char *mddev, struct mddev_dev *devlist, + struct shape *s, struct context *c) +--- a/Create.c ++++ b/Create.c +@@ -26,6 +26,7 @@ + #include "md_u.h" + #include "md_p.h" + #include ++#include + + static int default_layout(struct supertype *st, int level, int verbose) + { +--- a/Detail.c ++++ b/Detail.c +@@ -27,6 +27,7 @@ + #include "md_u.h" + #include + #include ++#include + + static int cmpstringp(const void *p1, const void *p2) + { +--- a/Grow.c ++++ b/Grow.c +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include + + #if ! defined(__BIG_ENDIAN) && ! defined(__LITTLE_ENDIAN) +--- a/Incremental.c ++++ b/Incremental.c +@@ -29,6 +29,7 @@ + */ + + #include "mdadm.h" ++#include + #include + #include + #include +--- a/Manage.c ++++ b/Manage.c +@@ -26,6 +26,7 @@ + #include "md_u.h" + #include "md_p.h" + #include ++#include + + int Manage_ro(char *devname, int fd, int readonly) + { +--- a/Monitor.c ++++ b/Monitor.c +@@ -25,6 +25,7 @@ + #include "mdadm.h" + #include "md_p.h" + #include "md_u.h" ++#include + #include + #include + #include +--- a/Query.c ++++ b/Query.c +@@ -25,6 +25,7 @@ + #include "mdadm.h" + #include "md_p.h" + #include "md_u.h" ++#include + + int Query(char *dev) + { +--- a/lib.c ++++ b/lib.c +@@ -25,6 +25,7 @@ + #include "mdadm.h" + #include "dlink.h" + #include ++#include + + /* This fill contains various 'library' style function. They + * have no dependency on anything outside this file. +--- a/mapfile.c ++++ b/mapfile.c +@@ -44,6 +44,7 @@ + */ + #include "mdadm.h" + #include ++#include + #include + + #define MAP_READ 0 +--- a/mdadm.c ++++ b/mdadm.c +@@ -28,6 +28,7 @@ + #include "mdadm.h" + #include "md_p.h" + #include ++#include + + static int scan_assemble(struct supertype *ss, + struct context *c, +--- a/mdopen.c ++++ b/mdopen.c +@@ -25,6 +25,7 @@ + #include "mdadm.h" + #include "md_p.h" + #include ++#include + + void make_parts(char *dev, int cnt) + { +--- a/platform-intel.c ++++ b/platform-intel.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + + static int devpath_to_ll(const char *dev_path, const char *entry, +--- a/policy.c ++++ b/policy.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include "dlink.h" + /* + * Policy module for mdadm. +--- a/super-ddf.c ++++ b/super-ddf.c +@@ -31,6 +31,7 @@ + #include "sha1.h" + #include + #include ++#include + + /* a non-official T10 name for creation GUIDs */ + static char T10[] = "Linux-MD"; +--- a/super-intel.c ++++ b/super-intel.c +@@ -24,6 +24,7 @@ + #include "platform-intel.h" + #include + #include ++#include + #include + #include + +--- a/sysfs.c ++++ b/sysfs.c +@@ -26,6 +26,7 @@ + #include "mdadm.h" + #include + #include ++#include + + #define MAX_SYSFS_PATH_LEN 120 + +--- a/util.c ++++ b/util.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/package/utils/mdadm/patches/200-reduce_size.patch b/package/utils/mdadm/patches/200-reduce_size.patch index 098fa1e1ec..3b6e879666 100644 --- a/package/utils/mdadm/patches/200-reduce_size.patch +++ b/package/utils/mdadm/patches/200-reduce_size.patch @@ -1,6 +1,6 @@ --- a/Incremental.c +++ b/Incremental.c -@@ -1619,6 +1619,10 @@ static int Incremental_container(struct supertype *st, char *devname, +@@ -1620,6 +1620,10 @@ static int Incremental_container(struct if (ra_all == ra_blocked) return 0; @@ -13,7 +13,7 @@ memcpy(suuid, uuid_zero, sizeof(int[4])); --- a/util.c +++ b/util.c -@@ -1220,7 +1220,9 @@ void wait_for(char *dev, int fd) +@@ -1221,7 +1221,9 @@ void wait_for(char *dev, int fd) struct superswitch *superlist[] = { &super0, &super1, -- 2.25.1