[OE-core] [PATCH 1/4] classes/base.bbclass: Add umask

Mark Hatle mark.hatle at windriver.com
Wed Jun 22 23:23:24 UTC 2011


In order for the build system to consistently create directories and files
with reasonable default permissions, we need to set the umask to a known
value, 022.

Prior to this patch we used the users umask and just verified it was
"compatible" with 022...

Note, this patch sets the umask -once- in the main bb thread.

Also remove the sanity check, as it's no longer needed.

Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
---
 meta/classes/base.bbclass   |   10 ++++++++++
 meta/classes/sanity.bbclass |    5 -----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 119b052..11ff0e0 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -13,6 +13,16 @@ inherit logging
 OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.packagegroup"
 OE_IMPORTS[type] = "list"
 
+# There are a few key items we need to setup in the environment
+# in order to get consistent builds.  Do them here.
+python oe_setup_env () {
+    if isinstance(e, bb.event.ConfigParsed) and bb.data.getVar("BB_WORKERCONTEXT", e.data, True) != "1":
+	import os
+	os.umask(0022)
+}
+
+addhandler oe_setup_env
+
 def oe_import(d):
     import os, sys
 
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index fc005aa..cd883be 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -224,11 +224,6 @@ def check_sanity(e):
     if os.path.basename(os.readlink('/bin/sh')) == 'dash':
         messages = messages + "Using dash as /bin/sh causes various subtle build problems, please use bash instead (e.g. 'dpkg-reconfigure dash' on an Ubuntu system.\n"
 
-    omask = os.umask(022)
-    if omask & 0755:
-        messages = messages + "Please use a umask which allows a+rx and u+rwx\n"
-    os.umask(omask)
-
     oes_bb_conf = data.getVar( 'OES_BITBAKE_CONF', e.data, True )
     if not oes_bb_conf:
         messages = messages + 'You do not include OpenEmbeddeds version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n'
-- 
1.7.3.4





More information about the Openembedded-core mailing list