summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/debian-conffile-location.diff115
-rw-r--r--debian/patches/debian-no-Werror.diff24
-rw-r--r--debian/patches/disable-incremental-assembly.patch12
-rw-r--r--debian/patches/mdmonitor-service-simplify.diff20
-rw-r--r--debian/patches/readlink-path.patch15
-rw-r--r--debian/patches/series8
-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
9 files changed, 281 insertions, 0 deletions
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/disable-incremental-assembly.patch b/debian/patches/disable-incremental-assembly.patch
new file mode 100644
index 00000000..693a65dc
--- /dev/null
+++ b/debian/patches/disable-incremental-assembly.patch
@@ -0,0 +1,12 @@
+--- a/udev-md-raid-assembly.rules
++++ b/udev-md-raid-assembly.rules
+@@ -25,6 +25,9 @@ GOTO="md_inc_end"
+
+ LABEL="md_inc"
+
++# Disable incremental assembly to fix Debian bug #784070
++GOTO="md_inc_end"
++
+ # remember you can limit what gets auto/incrementally assembled by
+ # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
+ ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $tempnode --offroot ${DEVLINKS}"
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/series b/debian/patches/series
new file mode 100644
index 00000000..9aa3e3d7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,8 @@
+debian-conffile-location.diff
+debian-no-Werror.diff
+sha1-includes.diff
+use-external-blkid.diff
+use-tempnode-not-devnode.patch
+readlink-path.patch
+mdmonitor-service-simplify.diff
+disable-incremental-assembly.patch
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}"