summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/build-sys-no-check_rundir.patch33
-rw-r--r--debian/patches/debian-conffile-location.diff115
-rw-r--r--debian/patches/debian-no-Werror.diff24
-rw-r--r--debian/patches/mdmonitor-service-simplify.diff20
-rw-r--r--debian/patches/readlink-path.patch15
-rw-r--r--debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch47
-rw-r--r--debian/patches/series9
-rw-r--r--debian/patches/sha1-includes.diff40
-rw-r--r--debian/patches/use-external-blkid.diff16
-rw-r--r--debian/patches/use-tempnode-not-devnode.patch31
10 files changed, 350 insertions, 0 deletions
diff --git a/debian/patches/build-sys-no-check_rundir.patch b/debian/patches/build-sys-no-check_rundir.patch
new file mode 100644
index 00000000..61f3a6f0
--- /dev/null
+++ b/debian/patches/build-sys-no-check_rundir.patch
@@ -0,0 +1,33 @@
+Subject: build-sys: do not depend on check_rundir for executables
+From: Michael Tokarev <mjt@tls.msk.ru>
+To: linux-raid@vger.kernel.org
+
+The problem is that the link lines will always be executed
+even if the executables are up to date.
+
+If anything, this check_rundir should be a dependency of
+install target, or some other "phony" target like this,
+since check_rundir is phony by itself.
+
+Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
+
+--- a/Makefile
++++ b/Makefile
+@@ -172,7 +172,7 @@ everything-test: all mdadm.static swap_super test_stripe \
+ # mdadm.uclibc and mdassemble.uclibc don't work on x86-64
+ # mdadm.tcc doesn't work..
+
+-mdadm : check_rundir $(OBJS)
++mdadm : $(OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
+
+ mdadm.static : $(OBJS) $(STATICOBJS)
+@@ -195,7 +195,7 @@ mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h
+ $(CC) -o mdmon.O2 $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS)
+
+ # use '-z now' to guarantee no dynamic linker interactions with the monitor thread
+-mdmon : check_rundir $(MON_OBJS)
++mdmon : $(MON_OBJS)
+ $(CC) $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS)
+ msg.o: msg.c msg.h
+
diff --git a/debian/patches/debian-conffile-location.diff b/debian/patches/debian-conffile-location.diff
new file mode 100644
index 00000000..8acc6077
--- /dev/null
+++ b/debian/patches/debian-conffile-location.diff
@@ -0,0 +1,115 @@
+From: martin f. krafft <madduck@debian.org>
+Subject: Set /etc/mdadm/mdadm.conf as primary config file location
+
+On Debian, the configuration file resides primarily in /etc/mdadm/mdadm.conf,
+/etc/mdadm.conf is only used as a backup.
+
+This is a Debian-specific patch.
+
+Forwarded: not-needed
+Reviewed-by: martin f. krafft <madduck@debian.org>
+
+---
+ Makefile | 4 ++--
+ ReadMe.c | 2 +-
+ mdadm.8.in | 14 ++++++--------
+ mdadm.conf.5 | 2 +-
+ mdassemble.8 | 2 +-
+ 5 files changed, 11 insertions(+), 13 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -61,8 +61,8 @@
+ PKG_CONFIG ?= pkg-config
+
+ SYSCONFDIR = /etc
+-CONFFILE = $(SYSCONFDIR)/mdadm.conf
+-CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf
++CONFFILE = $(SYSCONFDIR)/mdadm/mdadm.conf
++CONFFILE2 = $(SYSCONFDIR)/mdadm.conf
+ MAILCMD =/usr/sbin/sendmail -t
+ CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\"
+ # Both MAP_DIR and MDMON_DIR should be somewhere that persists across the
+--- a/ReadMe.c
++++ b/ReadMe.c
+@@ -590,7 +590,7 @@
+ ;
+
+ char Help_config[] =
+-"The /etc/mdadm.conf config file:\n\n"
++"The /etc/mdadm/mdadm.conf config file:\n\n"
+ " The config file contains, apart from blank lines and comment lines that\n"
+ " start with a hash(#), array lines, device lines, and various\n"
+ " configuration lines.\n"
+--- a/mdadm.8.in
++++ b/mdadm.8.in
+@@ -264,13 +264,13 @@
+ .TP
+ .BR \-c ", " \-\-config=
+ Specify the config file or directory. Default is to use
+-.B /etc/mdadm.conf
++.B /etc/mdadm/mdadm.conf
+ and
+-.BR /etc/mdadm.conf.d ,
++.BR /etc/mdadm/mdadm.conf.d ,
+ or if those are missing then
+-.B /etc/mdadm/mdadm.conf
++.B /etc/mdadm.conf
+ and
+-.BR /etc/mdadm/mdadm.conf.d .
++.BR /etc/mdadm.conf.d .
+ If the config file given is
+ .B "partitions"
+ then nothing will be read, but
+@@ -1742,9 +1742,9 @@
+ or requested with (a possibly implicit)
+ .BR \-\-scan .
+ In the later case,
+-.B /etc/mdadm.conf
+-or
+ .B /etc/mdadm/mdadm.conf
++or
++.B /etc/mdadm.conf
+ is used.
+
+ If
+@@ -3003,7 +3003,7 @@
+ is given in Misc mode, and to monitor array reconstruction
+ on Monitor mode.
+
+-.SS /etc/mdadm.conf
++.SS /etc/mdadm/mdadm.conf (or /etc/mdadm.conf)
+
+ The config file lists which devices may be scanned to see if
+ they contain MD super block, and gives identifying information
+@@ -3011,7 +3011,7 @@
+ .BR mdadm.conf (5)
+ for more details.
+
+-.SS /etc/mdadm.conf.d
++.SS /etc/mdadm/mdadm.conf.d (or /etc/mdadm.conf.d)
+
+ A directory containing configuration files which are read in lexical
+ order.
+--- a/mdadm.conf.5
++++ b/mdadm.conf.5
+@@ -8,7 +8,7 @@
+ .SH NAME
+ mdadm.conf \- configuration for management of Software RAID with mdadm
+ .SH SYNOPSIS
+-/etc/mdadm.conf
++/etc/mdadm/mdadm.conf
+ .SH DESCRIPTION
+ .PP
+ .I mdadm
+--- a/mdassemble.8
++++ b/mdassemble.8
+@@ -40,7 +40,7 @@
+
+ .SH FILES
+
+-.SS /etc/mdadm.conf
++.SS /etc/mdadm/mdadm.conf
+
+ The config file lists which devices may be scanned to see if
+ they contain MD super block, and gives identifying information
diff --git a/debian/patches/debian-no-Werror.diff b/debian/patches/debian-no-Werror.diff
new file mode 100644
index 00000000..0a427f16
--- /dev/null
+++ b/debian/patches/debian-no-Werror.diff
@@ -0,0 +1,24 @@
+From: martin f. krafft <madduck@debian.org>
+Subject: Remove -Werror from compiler flags
+
+-Werror seems like a bad idea on released/packaged code because a toolchain
+update (introducing new warnings) could break the build. We'll let upstream
+use it to beautify the code, but remove it for out builds.
+
+Signed-off-by: martin f. krafft <madduck@debian.org>
+
+---
+ Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -43,7 +43,7 @@
+
+ CC = $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
++CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
diff --git a/debian/patches/mdmonitor-service-simplify.diff b/debian/patches/mdmonitor-service-simplify.diff
new file mode 100644
index 00000000..ea706a68
--- /dev/null
+++ b/debian/patches/mdmonitor-service-simplify.diff
@@ -0,0 +1,20 @@
+Subject: simplify mdmonitor.service
+From: Michael Tokarev <mjt@tls.msk.ru>
+Date: Fri, 14 Nov 2014 19:18:05 +0300
+Bug-Debian: http://bugs.debian.org/764647
+Forwarded: no
+
+There isn't much for customization for mdadm --monitor.
+it'll just do what it's supposed to do, so just run it.
+
+--- a/systemd/mdmonitor.service
++++ b/systemd/mdmonitor.service
+@@ -10,7 +10,4 @@ Description=MD array monitor
+ DefaultDependencies=no
+
+ [Service]
+-Environment= MDADM_MONITOR_ARGS=--scan
+-EnvironmentFile=-/run/sysconfig/mdadm
+-ExecStartPre=-/usr/lib/systemd/scripts/mdadm_env.sh
+-ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS
++ExecStart=BINDIR/mdadm --monitor --scan
diff --git a/debian/patches/readlink-path.patch b/debian/patches/readlink-path.patch
new file mode 100644
index 00000000..86544592
--- /dev/null
+++ b/debian/patches/readlink-path.patch
@@ -0,0 +1,15 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Subject: readlink is in /bin not /usr/bin on debian
+Date: Fri, 14 Nov 2014 19:11:51 +0300
+Bug-Debian: http://bugs.debian.org/766416
+Forwarded: no
+
+This is a debian-specific change, upstream ships
+the rule to use /usr/bin/readlink while on debian
+it is /bin/readlink
+
+--- a/udev-md-raid-arrays.rules
++++ b/udev-md-raid-arrays.rules
+@@ -38 +38 @@ ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service"
+-ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c"
++ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c"
diff --git a/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch b/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch
new file mode 100644
index 00000000..f7c9b1b7
--- /dev/null
+++ b/debian/patches/rebuildmap-strip-local-host-name-from-device-name.patch
@@ -0,0 +1,47 @@
+From 628cdf19ea35daad22e409e51c0abc7ffb19d6aa Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Mon, 3 Nov 2014 12:49:05 +1100
+Subject: Rebuildmap: strip local host name from device name.
+
+When /run/mdadm/map is being rebuilt, e.g. by "mdadm -Ir",
+if the device doesn't exist in /dev, we have to choose
+a name.
+Currently we don't strip the hostname which is wrong if
+it is the local host.
+
+Reported-by: Stephen Kent <smkent@smkent.net>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ mapfile.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/mapfile.c b/mapfile.c
+index 4e7f242..41599df 100644
+--- a/mapfile.c
++++ b/mapfile.c
+@@ -455,12 +455,19 @@ void RebuildMap(void)
+ sep = "";
+ }
+ }
+- if (strchr(name, ':'))
+- /* probably a uniquifying
++ if (strchr(name, ':')) {
++ /* Probably a uniquifying
+ * hostname prefix. Allow
+- * without a suffix
++ * without a suffix, and strip
++ * hostname if it is us.
+ */
++ if (homehost && unum == -1 &&
++ strncmp(name, homehost,
++ strlen(homehost)) == 0 &&
++ name[strlen(homehost)] == ':')
++ name += strlen(homehost)+1;
+ unum = -1;
++ }
+
+ while (conflict) {
+ if (unum >= 0)
+--
+1.7.10.4
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..c13a5c88
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,9 @@
+debian-conffile-location.diff
+debian-no-Werror.diff
+sha1-includes.diff
+use-external-blkid.diff
+use-tempnode-not-devnode.patch
+build-sys-no-check_rundir.patch
+rebuildmap-strip-local-host-name-from-device-name.patch
+readlink-path.patch
+mdmonitor-service-simplify.diff
diff --git a/debian/patches/sha1-includes.diff b/debian/patches/sha1-includes.diff
new file mode 100644
index 00000000..0dfd7daf
--- /dev/null
+++ b/debian/patches/sha1-includes.diff
@@ -0,0 +1,40 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Subject: do not #include ansidecl.h from sha1.h, use system headers
+
+In 3.2.5 version of mdadm, new sha1 implementation has been included
+which tries to include ansidecl.h header which is internal to some
+other project. But this #include isn't really necessary, since this
+implementation does not actually use any defines from ansidecl.h. So
+just remove the #include, instead of adding a new external dependency.
+
+References: http://www.spinics.net/lists/raid/msg38859.html
+
+While at it, unconditionally include system headers like limits.h and
+stdint.h, since on a Linux system these headers are available, and
+these contains definitive information about real system types than
+any guesses.
+
+--- a/sha1.h
++++ b/sha1.h
+@@ -22,7 +22,7 @@
+
+ #include <stdio.h>
+
+-#if defined HAVE_LIMITS_H || _LIBC
++#if 1 /* defined HAVE_LIMITS_H || _LIBC */
+ # include <limits.h>
+ #endif
+
+@@ -33,9 +33,9 @@
+ the resulting executable. Locally running cross-compiled executables
+ is usually not possible. */
+
+-#ifdef _LIBC
+-# include <sys/types.h>
+-typedef u_int32_t sha1_uint32;
++#if 1 /* def _LIBC */
++# include <stdint.h>
++typedef uint32_t sha1_uint32;
+ typedef uintptr_t sha1_uintptr;
+ #else
+ # define INT_MAX_32_BITS 2147483647
diff --git a/debian/patches/use-external-blkid.diff b/debian/patches/use-external-blkid.diff
new file mode 100644
index 00000000..637f7c3a
--- /dev/null
+++ b/debian/patches/use-external-blkid.diff
@@ -0,0 +1,16 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Subject: blkid is not udev builtin, use /sbin/blkid
+
+--- a/udev-md-raid-arrays.rules
++++ b/udev-md-raid-arrays.rules
+@@ -26,9 +26,7 @@ ENV{DEVTYPE}=="partition", ENV{MD_UUID}=
+ ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
+ ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n"
+
+-IMPORT{builtin}="blkid"
+-OPTIONS+="link_priority=100"
+-OPTIONS+="watch"
++IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
+ ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+
diff --git a/debian/patches/use-tempnode-not-devnode.patch b/debian/patches/use-tempnode-not-devnode.patch
new file mode 100644
index 00000000..38a55044
--- /dev/null
+++ b/debian/patches/use-tempnode-not-devnode.patch
@@ -0,0 +1,31 @@
+From: Michael Tokarev <mjt@tls.msk.ru>
+Subject: use tempnode not devnode in udev rules
+Bug-Debian: http://bugs.debian.org/770883
+Forwarded: no
+
+udev in wheezy does not understand $devnode construct
+in rules file, while upstream uses it in mdadm rules
+files. udev in jessie has $devnode and it also supports
+old $tempnode which is the way it worked in wheezy and
+before, even if $tempnode in jessie's udev is not documented.
+So on jessie, both $tempnode and $devnode works fine, while
+in wheezy, only $tempnode works.
+
+Use $tempnode instead of $devnode. Since mdadm is important
+enough for system functionality and easily can break system
+by making it unbootable, and this is the only incompatibility
+between wheezy's and jessie's udev wrt mdadm, it is better than
+having a versioned dependency on udev.
+
+This patch is debian-specific and should be dropped for jessie+1.
+
+--- a/udev-md-raid-arrays.rules
++++ b/udev-md-raid-arrays.rules
+@@ -20 +20 @@
+-IMPORT{program}="BINDIR/mdadm --detail --export $devnode"
++IMPORT{program}="BINDIR/mdadm --detail --export $tempnode"
+--- a/udev-md-raid-assembly.rules
++++ b/udev-md-raid-assembly.rules
+@@ -30 +30 @@
+-ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $devnode --offroot ${DEVLINKS}"
++ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $tempnode --offroot ${DEVLINKS}"