public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/mdadm/files/, sys-fs/mdadm/
Date: Thu, 14 Mar 2024 03:42:08 +0000 (UTC)	[thread overview]
Message-ID: <1710387725.16001ee3172451f6574dbe8c5b7f71ac0d43d3e2.robbat2@gentoo> (raw)

commit:     16001ee3172451f6574dbe8c5b7f71ac0d43d3e2
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 14 03:39:47 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 03:42:05 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16001ee3

sys-fs/mdadm: bump

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/833000

 sys-fs/mdadm/Manifest                              |   2 +
 .../files/mdadm-4.3-in_initrd-collision.patch      |  45 ++++++++
 sys-fs/mdadm/files/mdadm-4.3-ldflags.patch         |  11 ++
 sys-fs/mdadm/mdadm-4.3.ebuild                      | 124 +++++++++++++++++++++
 sys-fs/mdadm/metadata.xml                          |   3 +
 5 files changed, 185 insertions(+)

diff --git a/sys-fs/mdadm/Manifest b/sys-fs/mdadm/Manifest
index 961f422d5fb6..51cfc9e15326 100644
--- a/sys-fs/mdadm/Manifest
+++ b/sys-fs/mdadm/Manifest
@@ -1,2 +1,4 @@
 DIST mdadm-4.2.tar.xz 453624 BLAKE2B de7c4318dc5479de41378233869ab84ca2cd0e8a42310157b1acb969e7152af61556fbbe6f17bf6af4dfaf5543e49b1c982d2baeedf1c39b000032f4db7f5502 SHA512 57897a2b7fb8b0b88bece50501099872bb45ddb076cfc323d563588096d2b66b1ecba3724534943f651ace2bfe591482570700616500dc3398552e4f9ff0c37d
+DIST mdadm-4.3.tar.xz 465820 BLAKE2B 3b6955339adb6c254a69d698e3b807838f8840e37f7f94280f4a1fbffb082ee694309f4b6f9adc8edfa2071fde324bf00ae0493d5b2e6c8d87796783dfa3ee1c SHA512 e44977f2f80d2471cb313803a60c92dafe8282ac06bbbfd41ae90ca493c64a3da94db924538788d045fd7f0667333912dabedb0b070f9abf5c0540b32e0fa08f
 DIST mdadm_4.2~rc2-7.debian.tar.xz 89904 BLAKE2B dd04f2dd044d0bca85920eaf5c79a288d69c47a7ad7e36509a126c01ef63bd045d7e0530450650028de39d74ad852995ca080c3a73dbcb1cf1b3783118109f35 SHA512 3d36533d2713b663606919b2bfec18b15e18a6a0194e333e38e4a58f175da96af7b1fe16f0c36ee148e14492a4e0710b9fad6ac7856495b63c0176ebb7333be6
+DIST mdadm_4.3-1.debian.tar.xz 86972 BLAKE2B 52af9ddacc402d8c3318bac31b4cd5ac3045e564832546146ba0a18d6a43866ae2c21270ac15f48df98c4f76af0eeae41679ea9e0e265dad44914bd58f27d689 SHA512 1c5203523f0c7fe271d850ab4ad376a449e870f8f1549dc4460adede1f59a1a364e741562954297e7848bae19d1cfe273a31f1bfaf739dd37559a0666abd8517

diff --git a/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch b/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch
new file mode 100644
index 000000000000..54e4aadacb58
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-4.3-in_initrd-collision.patch
@@ -0,0 +1,45 @@
+Fix collision with libudev symbols when statically linking.
+
+https://bugs.gentoo.org/830485
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -1665,7 +1665,7 @@
+ extern void udev_block(char *devnm);
+ extern void udev_unblock(void);
+ 
+-extern int in_initrd(void);
++extern int mdadm_in_initrd(void);
+ 
+ struct cmap_hooks {
+ 	void *cmap_handle;      /* corosync lib related */
+--- a/mdmon.c
++++ b/mdmon.c
+@@ -309,7 +309,7 @@
+ 		{NULL, 0, NULL, 0}
+ 	};
+ 
+-	if (in_initrd()) {
++	if (mdadm_in_initrd()) {
+ 		/*
+ 		 * set first char of argv[0] to @. This is used by
+ 		 * systemd to signal that the task was launched from
+--- a/util.c
++++ b/util.c
+@@ -1960,7 +1960,7 @@
+ 	int len;
+ 	pid_t pid;
+ 	int status;
+-	char *prefix = in_initrd() ? "initrd-" : "";
++	char *prefix = mdadm_in_initrd() ? "initrd-" : "";
+ 	char pathbuf[1024];
+ 	char *paths[4] = {
+ 		pathbuf,
+@@ -2219,7 +2219,7 @@
+ 	return 0;
+ }
+ 
+-int in_initrd(void)
++int mdadm_in_initrd(void)
+ {
+ 	/* This is based on similar function in systemd. */
+ 	struct statfs s;

diff --git a/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch b/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch
new file mode 100644
index 000000000000..e8e93d424592
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-4.3-ldflags.patch
@@ -0,0 +1,11 @@
+--- mdadm-4.3/Makefile.orig	2024-03-13 20:11:48.949678469 -0700
++++ mdadm-4.3/Makefile	2024-03-13 20:11:52.773671814 -0700
+@@ -132,7 +132,7 @@
+ MON_LDFLAGS += -pthread
+ endif
+ 
+-LDFLAGS = -Wl,-z,now,-z,noexecstack
++LDFLAGS += -Wl,-z,now,-z,noexecstack
+ 
+ # If you want a static binary, you might uncomment these
+ # LDFLAGS += -static

diff --git a/sys-fs/mdadm/mdadm-4.3.ebuild b/sys-fs/mdadm/mdadm-4.3.ebuild
new file mode 100644
index 000000000000..c78553aa7558
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-4.3.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic systemd toolchain-funcs udev
+
+DESCRIPTION="Tool for running RAID systems - replacement for the raidtools"
+HOMEPAGE="https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/"
+DEB_PF="4.3-1"
+SRC_URI="https://www.kernel.org/pub/linux/utils/raid/mdadm/${P/_/-}.tar.xz
+		mirror://debian/pool/main/m/mdadm/${PN}_${DEB_PF}.debian.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+[[ "${PV}" = *_rc* ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="static systemd +udev corosync"
+
+REQUIRED_USE="static? ( !udev )"
+
+BDEPEND="app-arch/xz-utils
+	virtual/pkgconfig"
+DEPEND="udev? ( virtual/libudev:= )
+	corosync? ( sys-cluster/corosync )"
+RDEPEND="${DEPEND}
+	>=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+PATCHES=(
+	#"${FILESDIR}/${PN}"-3.4-sysmacros.patch #580188 # upstream has it later in the list of includes as of 4.3.
+	"${FILESDIR}/${PN}"-4.3-in_initrd-collision.patch #830461
+	"${FILESDIR}/${PN}"-4.2-mdadm_env.patch #628968
+	"${FILESDIR}/${PN}"-4.3-ldflags.patch
+	"${WORKDIR}/debian/patches/debian/0001-fix-manpages.patch"
+	"${WORKDIR}/debian/patches/debian/0003-host-name-in-default-mailfrom.patch"
+	"${WORKDIR}/debian/patches/debian/0004-exit-gracefully-when-md-device-not-found.patch"
+	"${WORKDIR}/debian/patches/debian/0007-no-Werror.patch"
+)
+
+mdadm_emake() {
+	# We should probably make corosync & libdlm into USE flags. #573782
+	local args=(
+		PKG_CONFIG="$(tc-getPKG_CONFIG)"
+		CC="$(tc-getCC)"
+		CWFLAGS="-Wall"
+		CXFLAGS="${CFLAGS}"
+		LDFLAGS="${LDFLAGS}"
+		UDEVDIR="$(get_udevdir)"
+		SYSTEMD_DIR="$(systemd_get_systemunitdir)"
+		COROSYNC="$(usex corosync '' -DNO_COROSYNC)"
+		DLM="-DNO_DLM"
+
+		# https://bugs.gentoo.org/732276
+		STRIP=
+
+		"$@"
+	)
+	emake "${args[@]}"
+}
+
+src_compile() {
+	use static && append-ldflags -static
+
+	# CPPFLAGS won't work for this
+	use udev || append-cflags -DNO_LIBUDEV
+
+	# bug 907082
+	use elibc_musl && append-cppflags -D_LARGEFILE64_SOURCE
+
+	mdadm_emake all
+}
+
+src_test() {
+	mdadm_emake test
+
+	sh ./test || die
+}
+
+src_install() {
+	mdadm_emake DESTDIR="${D}" install install-systemd
+	dodoc ChangeLog INSTALL TODO README* ANNOUNCE-*
+
+	# install mdcheck_start.service
+	# needed for systemd units https://bugs.gentoo.org/833000
+	exeinto /usr/share/mdadm/
+	doexe misc/mdcheck
+
+	insinto /etc
+	newins mdadm.conf-example mdadm.conf
+	newinitd "${FILESDIR}"/mdadm.rc mdadm
+	newconfd "${FILESDIR}"/mdadm.confd mdadm
+	newinitd "${FILESDIR}"/mdraid.rc mdraid
+	newconfd "${FILESDIR}"/mdraid.confd mdraid
+
+	# From the Debian patchset
+	into /usr
+	dodoc "${WORKDIR}"/debian/local/doc/README.checkarray
+	dosbin "${WORKDIR}"/debian/local/bin/checkarray
+	insinto /etc/default
+	newins "${FILESDIR}"/etc-default-mdadm mdadm
+
+	exeinto /etc/cron.weekly
+	newexe "${FILESDIR}"/mdadm.weekly mdadm
+}
+
+pkg_postinst() {
+	udev_reload
+	if ! systemd_is_booted; then
+		if [[ -z ${REPLACING_VERSIONS} ]] ; then
+			# Only inform people the first time they install.
+			elog "If you're not relying on kernel auto-detect of your RAID"
+			elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+			elog "	rc-update add mdraid boot"
+		fi
+	fi
+}
+
+pkg_postrm() {
+	udev_reload
+}

diff --git a/sys-fs/mdadm/metadata.xml b/sys-fs/mdadm/metadata.xml
index 536bb38d9f1d..1ce6bb33ddd3 100644
--- a/sys-fs/mdadm/metadata.xml
+++ b/sys-fs/mdadm/metadata.xml
@@ -5,6 +5,9 @@
 	<email>base-system@gentoo.org</email>
 	<name>Gentoo Base System</name>
 </maintainer>
+<use>
+	<flag name="corosync">Support for corosync cluster engine</flag>
+</use>
 <upstream>
 	<remote-id type="cpe">cpe:/a:mdadm_project:mdadm</remote-id>
 </upstream>


             reply	other threads:[~2024-03-14  3:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  3:42 Robin H. Johnson [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-30 15:38 [gentoo-commits] repo/gentoo:master commit in: sys-fs/mdadm/files/, sys-fs/mdadm/ Andreas K. Hüttel
2024-02-19 21:00 Robin H. Johnson
2018-03-27  9:13 Lars Wendler
2017-01-10 19:05 Lars Wendler
2016-01-28 10:22 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1710387725.16001ee3172451f6574dbe8c5b7f71ac0d43d3e2.robbat2@gentoo \
    --to=robbat2@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox