mdadm: fix build to include mdadm.static, FS#1909

This commit is contained in:
Juergen Daubert 2022-05-02 10:39:02 +02:00
parent 15978cfd30
commit a680fbba98
4 changed files with 50 additions and 6 deletions

View File

@ -7,6 +7,7 @@ drwxr-xr-x root/root lib/udev/rules.d/
-rw-r--r-- root/root lib/udev/rules.d/69-md-clustered-confirm-device.rules
drwxr-xr-x root/root sbin/
-rwxr-xr-x root/root sbin/mdadm
-rwxr-xr-x root/root sbin/mdadm.static
-rwxr-xr-x root/root sbin/mdmon
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/share/

View File

@ -1,5 +1,6 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/YD/6ruCc0ipkyJbqulcEgJw/tb/LXUsuoAo8nrwIidQPc/nxuUj8qjh9GiYWDP9uN3lMHMjvsed9HSxqH8KRQk=
SHA256 (Pkgfile) = 927b9c4a3ce5426ddce456b0d652d8d2f0144ed61fbc36b07af07c75251ff7f0
SHA256 (.footprint) = f6fb169413c9d444a06adcd569190d40d94b2f0ba894700e9618e2c645be0af4
RWSE3ohX2g5d/QV4z+yAxpSIo1pWGSjC3+35rblNI3f6cRIHYgzUME1Jej1exysW1QwZdUPnFPS8/QO5FpcTw4WxyORFaqlXSg4=
SHA256 (Pkgfile) = 434ea877d0d09bf2fadaf3671f9b8a89ebef2ac2ad213aeaf914defd61384c76
SHA256 (.footprint) = d7baf236eb68b06048b0bb5b21ad7cbf892f81d7f6f49361fa854c7306ed8a0e
SHA256 (mdadm-4.2.tar.xz) = 461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d
SHA256 (mdadm-4.2-in_initrd-collision.patch) = b51e7df9175cdb2e90d541756ac90c5d2abc2be1e410c3d07e0f349c1a45a39c

View File

@ -4,11 +4,17 @@
name=mdadm
version=4.2
release=1
source=(http://www.kernel.org/pub/linux/utils/raid/$name/$name-$version.tar.xz)
release=2
source=(http://www.kernel.org/pub/linux/utils/raid/$name/$name-$version.tar.xz
$name-$version-in_initrd-collision.patch)
build() {
cd $name-$version
make
# From gentoo
patch -p1 -i $SRC/$name-$version-in_initrd-collision.patch
make all mdadm.static
make DESTDIR=$PKG install
install -m0755 mdadm.static $PKG/sbin
}

View File

@ -0,0 +1,36 @@
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
@@ -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;