From aeb5c81ce48ce4ccf348207aa07c2c41ade69237 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 14 Feb 2025 06:34:56 +0100 Subject: [PATCH] Adding slightly adjusted patch from Chris Hofstaedtler to install into usrmerged layout (Closes: #1073726). Signed-off-by: Daniel Baumann --- debian/control | 2 ++ debian/mdadm-udeb.install | 4 ++-- debian/mdadm.install | 3 +-- debian/mdadm.lintian-overrides | 2 +- .../debian/0012-systemd-directory.patch | 19 +++++++++++++++++++ .../patches/debian/0013-bin-directory.patch | 15 +++++++++++++++ debian/patches/series | 2 ++ 7 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 debian/patches/debian/0012-systemd-directory.patch create mode 100644 debian/patches/debian/0013-bin-directory.patch diff --git a/debian/control b/debian/control index 02dbb13..500d097 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,8 @@ Maintainer: Daniel Baumann Build-Depends: debhelper-compat (= 13), libudev-dev, + pkgconf, + systemd-dev, Rules-Requires-Root: no Standards-Version: 4.7.0 Homepage: https://raid.wiki.kernel.org diff --git a/debian/mdadm-udeb.install b/debian/mdadm-udeb.install index 6ceeebf..97df6c8 100644 --- a/debian/mdadm-udeb.install +++ b/debian/mdadm-udeb.install @@ -1,2 +1,2 @@ -lib/udev/rules.d/63-md-raid-arrays.rules -sbin/ +usr/lib/udev/rules.d/63-md-raid-arrays.rules +usr/sbin/ diff --git a/debian/mdadm.install b/debian/mdadm.install index 1bda1e0..ec842dc 100644 --- a/debian/mdadm.install +++ b/debian/mdadm.install @@ -2,6 +2,5 @@ debian/local/apport/* usr/share/apport/package-hooks debian/local/bin/* usr/share/mdadm debian/local/initramfs-tools/* usr/share/initramfs-tools/scripts debian/local/reportbug/* usr/share/bug/mdadm -lib/ misc/mdcheck usr/share/mdadm/ -sbin/ +usr/ diff --git a/debian/mdadm.lintian-overrides b/debian/mdadm.lintian-overrides index c748de8..ba1d416 100644 --- a/debian/mdadm.lintian-overrides +++ b/debian/mdadm.lintian-overrides @@ -2,4 +2,4 @@ init.d-script-possible-missing-stop etc/init.d/mdadm-waitidle 1 # mdadm forks mdmon as required, not sure it should start separately -systemd-service-file-missing-install-key lib/systemd/system/mdmonitor.service +systemd-service-file-missing-install-key usr/lib/systemd/system/mdmonitor.service diff --git a/debian/patches/debian/0012-systemd-directory.patch b/debian/patches/debian/0012-systemd-directory.patch new file mode 100644 index 0000000..13e75b6 --- /dev/null +++ b/debian/patches/debian/0012-systemd-directory.patch @@ -0,0 +1,19 @@ +Author: Chris Hofstaedtler +Description: Patch Makefile to use pkg-config systemd to discover systemd unit dir. + +diff -Naurp mdadm.orig/Makefile mdadm/Makefile +--- mdadm.orig/Makefile ++++ mdadm/Makefile +@@ -106,7 +106,11 @@ MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(RUN_DIR) + # place for autoreplace cookies + FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots +-SYSTEMD_DIR=/lib/systemd/system ++SYSTEMD_DIR := $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd 2>/dev/null) ++ifndef SYSTEMD_DIR ++ SYSTEMD_DIR=/lib/systemd/system ++endif ++ + LIB_DIR=/usr/libexec/mdadm + + COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC) diff --git a/debian/patches/debian/0013-bin-directory.patch b/debian/patches/debian/0013-bin-directory.patch new file mode 100644 index 0000000..6802e32 --- /dev/null +++ b/debian/patches/debian/0013-bin-directory.patch @@ -0,0 +1,15 @@ +Author: Chris Hofstaedtler +Description: Patch Makefile to use /usr/sbin instead of /sbin. + +diff -Naurp mdadm.orig/Makefile mdadm/Makefile +--- mdadm.orig/Makefile ++++ mdadm/Makefile +@@ -146,7 +150,7 @@ endif + + INSTALL = /usr/bin/install + DESTDIR = +-BINDIR = /sbin ++BINDIR = /usr/sbin + MANDIR = /usr/share/man + MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 diff --git a/debian/patches/series b/debian/patches/series index b6e5be4..bcec2c5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -9,3 +9,5 @@ debian/0008-test-installed.patch debian/0009-randomize-timers.patch debian/0010-systemd-honor-debconf-daily-scan.patch debian/0011-mdcheck-fix-empty-spaces-in-timer-unit-files.patch +debian/0012-systemd-directory.patch +debian/0013-bin-directory.patch