All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Parallel make bug in Makefile of mdadm-3.3.1 (corrupted udev rules and/or systemd services)
@ 2014-07-17  7:30 Samuli Suominen
  2014-07-17  7:45 ` Samuli Suominen
  2014-07-17  8:25 ` NeilBrown
  0 siblings, 2 replies; 5+ messages in thread
From: Samuli Suominen @ 2014-07-17  7:30 UTC (permalink / raw)
  To: linux-raid

[-- Attachment #1: Type: text/plain, Size: 655 bytes --]

If you run with:

$ export MAKEFLAGS="-j9"
$ make install install-systemd

As in, combine "install" and "install-systemd" in the same command using
parallel make,
the content of .service files could end up in .rules, or otherway around
because GNU
make fill run them in parallel and the commands might ran at the same
time, and both
use same variables $file and same temporary files .install.tmp

This was reported at,
https://bugs.gentoo.org/show_bug.cgi?id=517218

The immediate workaround is,

$ export MAKEFLAGS="-j9"
$ make install
$ make install-systemd

And the attach patch makes it full proof so they can be ran at the same
line.

Thanks,
Samuli

[-- Attachment #2: parallel-make.patch --]
[-- Type: text/x-patch, Size: 2579 bytes --]

diff -ur mdadm-3.3.1.orig/Makefile mdadm-3.3.1/Makefile
--- mdadm-3.3.1.orig/Makefile	2014-06-05 09:45:56.000000000 +0300
+++ mdadm-3.3.1/Makefile	2014-07-17 09:52:51.670100989 +0300
@@ -281,26 +281,26 @@
 	$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
 
 install-udev: udev-md-raid-arrays.rules udev-md-raid-assembly.rules
-	@for file in 63-md-raid-arrays.rules 64-md-raid-assembly.rules ; \
-	do sed -e 's,BINDIR,$(BINDIR),g' udev-$${file#??-} > .install.tmp && \
-	   echo $(INSTALL) -D -m 644 udev-$${file#??-} $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \
-	   $(INSTALL) -D -m 644 .install.tmp $(DESTDIR)$(UDEVDIR)/rules.d/$$file ; \
-	   rm -f .install.tmp; \
+	@for file1 in 63-md-raid-arrays.rules 64-md-raid-assembly.rules ; \
+	do sed -e 's,BINDIR,$(BINDIR),g' udev-$${file1#??-} > .install.tmp.1 && \
+	   echo $(INSTALL) -D -m 644 udev-$${file1#??-} $(DESTDIR)$(UDEVDIR)/rules.d/$$file1 ; \
+	   $(INSTALL) -D -m 644 .install.tmp.1 $(DESTDIR)$(UDEVDIR)/rules.d/$$file1 ; \
+	   rm -f .install.tmp.1; \
 	done
 
 install-systemd: systemd/mdmon@.service
-	@for file in mdmon@.service mdmonitor.service mdadm-last-resort@.timer \
+	@for file2 in mdmon@.service mdmonitor.service mdadm-last-resort@.timer \
 		mdadm-last-resort@.service ; \
-	do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp && \
-	   echo $(INSTALL) -D -m 644 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
-	   $(INSTALL) -D -m 644 .install.tmp $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
-	   rm -f .install.tmp; \
+	do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file2 > .install.tmp.2 && \
+	   echo $(INSTALL) -D -m 644 systemd/$$file2 $(DESTDIR)$(SYSTEMD_DIR)/$$file2 ; \
+	   $(INSTALL) -D -m 644 .install.tmp.2 $(DESTDIR)$(SYSTEMD_DIR)/$$file2 ; \
+	   rm -f .install.tmp.2; \
 	done
-	@for file in mdadm.shutdown ; \
-	do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp && \
-	   echo $(INSTALL) -D -m 755  systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
-	   $(INSTALL) -D -m 755  .install.tmp $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file ; \
-	   rm -f .install.tmp; \
+	@for file3 in mdadm.shutdown ; \
+	do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file3 > .install.tmp.3 && \
+	   echo $(INSTALL) -D -m 755  systemd/$$file3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file3 ; \
+	   $(INSTALL) -D -m 755  .install.tmp.3 $(DESTDIR)$(SYSTEMD_DIR)-shutdown/$$file3 ; \
+	   rm -f .install.tmp.3; \
 	done
 	if [ -f /etc/SuSE-release -o -n "$(SUSE)" ] ;then $(INSTALL) -D -m 755 systemd/SUSE-mdadm_env.sh $(DESTDIR)$(SYSTEMD_DIR)/../scripts/mdadm_env.sh ;fi
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-18 13:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17  7:30 [PATCH] Parallel make bug in Makefile of mdadm-3.3.1 (corrupted udev rules and/or systemd services) Samuli Suominen
2014-07-17  7:45 ` Samuli Suominen
2014-07-17  8:25 ` NeilBrown
2014-07-17  8:31   ` Samuli Suominen
2014-07-18 13:51     ` Samuli Suominen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.