Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] Makefile: don't depend on the umask
@ 2015-07-13 10:57 Thomas Petazzoni
  2015-07-16 20:52 ` [Buildroot] Major regression introduced by "Makefile: don't depend on the umask" Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-07-13 10:57 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=bee5745ccc20be6dbba243b1f8af0d5c522923e8
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Some packages and BR itself create files and directories on the target
with cp/mkdir/etc which depend on the umask at the time of building.

To fix this, use a trick inside the Makefile which wraps all rules when
the umask is not 0022. This sets the umask at the top level, and then
the building process continues as usual.

[Thomas: add --no-print-directory, as suggested by Arnout.]

Signed-off-by: Guido Mart??nez <guido@vanguardiasur.com.ar>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 Makefile |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index daf692e..55b1d45 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,19 @@
 # You shouldn't need to mess with anything beyond this point...
 #--------------------------------------------------------------
 
+# Trick for always running with a fixed umask
+UMASK=0022
+ifneq ($(shell umask),$(UMASK))
+.PHONY: all $(MAKECMDGOALS)
+
+all:
+	@umask $(UMASK) && $(MAKE) --no-print-directory
+
+$(MAKECMDGOALS):
+	@umask $(UMASK) && $(MAKE) --no-print-directory $@
+
+else # umask
+
 # This is our default rule, so must come first
 all:
 
@@ -937,3 +950,5 @@ include docs/manual/manual.mk
 -include $(BR2_EXTERNAL)/docs/*/*.mk
 
 .PHONY: $(noconfig_targets)
+
+endif #umask

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

end of thread, other threads:[~2015-07-16 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 10:57 [Buildroot] [git commit] Makefile: don't depend on the umask Thomas Petazzoni
2015-07-16 20:52 ` [Buildroot] Major regression introduced by "Makefile: don't depend on the umask" Thomas Petazzoni
2015-07-16 21:55   ` [Buildroot] [PATCH] Makefile: optimize umask setting Guido Martínez
2015-07-16 22:09     ` Arnout Vandecappelle
2015-07-16 22:03   ` [Buildroot] [PATCH] Makefile: fix performance regression introduced by "Makefile: don't depend on the umask" Arnout Vandecappelle
2015-07-16 22:19     ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox