From: ankur.tyagi85@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: Ankur Tyagi <ankur.tyagi85@gmail.com>
Subject: [OE-core][PATCH v2 2/2] mdadm: catch sed substitution failure during install
Date: Tue, 17 Feb 2026 11:11:18 +1300 [thread overview]
Message-ID: <20260216221118.2240588-2-ankur.tyagi85@gmail.com> (raw)
In-Reply-To: <20260216221118.2240588-1-ankur.tyagi85@gmail.com>
From: Ankur Tyagi <ankur.tyagi85@gmail.com>
This patch is to validate a possible race condition theory during install.
Also fail the build if sed substitution still fails for further investigation.
Details: https://bugzilla.yoctoproject.org/show_bug.cgi?id=16166
[YOCTO #16166]
Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
...1-Makefile-install-rule-improvements.patch | 64 +++++++++++++++++++
meta/recipes-extended/mdadm/mdadm_4.5.bb | 13 +++-
2 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-extended/mdadm/files/0001-Makefile-install-rule-improvements.patch
diff --git a/meta/recipes-extended/mdadm/files/0001-Makefile-install-rule-improvements.patch b/meta/recipes-extended/mdadm/files/0001-Makefile-install-rule-improvements.patch
new file mode 100644
index 0000000000..feb4c5d926
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/0001-Makefile-install-rule-improvements.patch
@@ -0,0 +1,64 @@
+From 21310a9249e21c3dbdb6a6b8e07e74bf0a4557bc Mon Sep 17 00:00:00 2001
+From: Ankur Tyagi <ankur.tyagi85@gmail.com>
+Date: Tue, 17 Feb 2026 08:41:48 +1300
+Subject: [PATCH] Makefile: install rule improvements
+
+- Removed double install logic
+- Use unique temp files
+
+Upstream-Status: Pending
+
+Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
+---
+ Makefile | 30 ++++++++++++++----------------
+ 1 file changed, 14 insertions(+), 16 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 788ff5d9..a4d4f178 100644
+--- a/Makefile
++++ b/Makefile
+@@ -298,30 +298,28 @@ install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
+ install-udev: udev-md-raid-arrays.rules udev-md-raid-assembly.rules udev-md-raid-creating.rules \
+ udev-md-clustered-confirm-device.rules
+ @for file in $(UDEV_RULES); \
+- do sed -e 's,BINDIR,$(BINDIR),g' udev-$${file#??-} > .install.tmp.1 && \
+- $(ECHO) $(INSTALL) -D -m 644 udev-$${file#??-} $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \
+- $(INSTALL) -D -m 644 .install.tmp.1 $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \
+- rm -f .install.tmp.1; \
++ do \
++ srcfile=udev-$${file#??-} ; \
++ sed -e 's,BINDIR,$(BINDIR),g' $$srcfile > $$srcfile.tmp && \
++ $(INSTALL) -D -m 644 $$srcfile.tmp $(DESTDIR)$(UDEVDIR)/rules.d/$$file && \
++ rm -f $$srcfile.tmp ; \
+ done
+
+ install-systemd: systemd/mdmon@.service
+ @for file in $(SYSTEMD_UNITS); \
+- do sed -e 's,BINDIR,$(BINDIR),g;s,MISCDIR,$(MISCDIR),g' systemd/$$file > .install.tmp.2 && \
+- $(ECHO) $(INSTALL) -D -m 644 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
+- $(INSTALL) -D -m 644 .install.tmp.2 $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
+- rm -f .install.tmp.2; \
++ do sed -e 's,BINDIR,$(BINDIR),g;s,MISCDIR,$(MISCDIR),g' systemd/$$file > systemd/$$file.tmp && \
++ $(INSTALL) -D -m 644 systemd/$$file.tmp $(DESTDIR)$(SYSTEMD_DIR)/$$file && \
++ rm -f systemd/$$file.tmp; \
+ done
+ @for file in mdadm.shutdown ; \
+- do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp.3 && \
+- $(ECHO) $(INSTALL) -D -m 755 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
+- $(INSTALL) -D -m 755 .install.tmp.3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
+- rm -f .install.tmp.3; \
++ do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > systemd/$$file.tmp && \
++ $(INSTALL) -D -m 755 systemd/$$file.tmp $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file && \
++ rm -f systemd/$$file.tmp; \
+ done
+ @for file in mdcheck ; \
+- do sed -e 's,BINDIR,$(BINDIR),g' misc/$$file > .install.tmp.4 && \
+- $(ECHO) $(INSTALL) -D -m 755 misc/$$file $(DESTDIR)$(MISCDIR)/$$file ; \
+- $(INSTALL) -D -m 755 .install.tmp.4 $(DESTDIR)$(MISCDIR)/$$file ; \
+- rm -f .install.tmp.4; \
++ do sed -e 's,BINDIR,$(BINDIR),g' misc/$$file > misc/$$file.tmp && \
++ $(INSTALL) -D -m 755 misc/$$file.tmp $(DESTDIR)$(MISCDIR)/$$file && \
++ rm -f misc/$$file.tmp; \
+ done
+
+ install-bin: mdadm mdmon
diff --git a/meta/recipes-extended/mdadm/mdadm_4.5.bb b/meta/recipes-extended/mdadm/mdadm_4.5.bb
index b30d3d776e..bca70aeaf0 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.5.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.5.bb
@@ -14,6 +14,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/mdadm/mdadm.git;protocol=https;bra
file://mdadm.init \
file://0002-Create.c-include-linux-falloc.h-for-FALLOC_FL_ZERO_R.patch \
file://0001-raid6check.c-restripe.c-Use-64-bit-off_t-across-both.patch \
+ file://0001-Makefile-install-rule-improvements.patch \
"
SRCREV = "8f0c7692d48414ff7b3fe927ce75799c65ef24b1"
@@ -40,11 +41,21 @@ EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CWFLAGS="" CXFLAGS="${CFLAGS}" SYSTEMD_DIR=${sys
DEBUG_OPTIMIZATION:append = " -Wno-error"
do_install() {
- oe_runmake 'DESTDIR=${D}' install install-systemd
+ install -d ${D}/${datadir}/
+
+ oe_runmake -j 1 'DESTDIR=${D}' install install-systemd
+
install -d ${D}/${sysconfdir}/
install -m 644 ${S}/documentation/mdadm.conf-example ${D}${sysconfdir}/mdadm.conf
install -d ${D}/${sysconfdir}/init.d
install -m 755 ${UNPACKDIR}/mdadm.init ${D}${sysconfdir}/init.d/mdmonitor
+ # temp change
+ install -m 644 ${S}/udev-md-raid-safe-timeouts.rules ${D}/${sysconfdir}/tmp-file
+
+ if grep -q "BINDIR" ${D}${datadir}/${BPN}/mdcheck; then
+ bberror "Build failed: 'BINDIR' placeholder found in mdcheck."
+ bbfatal_log "sed command in Makefile failed to execute correctly."
+ fi
}
do_compile_ptest() {
next prev parent reply other threads:[~2026-02-16 22:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 22:11 [OE-core][PATCH v2 1/2] mdadm: upgrade 4.4 -> 4.5 ankur.tyagi85
2026-02-16 22:11 ` ankur.tyagi85 [this message]
2026-02-17 9:39 ` [OE-core][PATCH v2 2/2] mdadm: catch sed substitution failure during install Alexander Kanavin
2026-02-17 22:22 ` Ankur Tyagi
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=20260216221118.2240588-2-ankur.tyagi85@gmail.com \
--to=ankur.tyagi85@gmail.com \
--cc=openembedded-core@lists.openembedded.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