aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/icecc.bbclass2
-rw-r--r--meta/conf/bitbake.conf3
-rw-r--r--meta/lib/oe/utils.py15
3 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
index 794e9930ad..c39c86458a 100644
--- a/meta/classes/icecc.bbclass
+++ b/meta/classes/icecc.bbclass
@@ -41,6 +41,8 @@ ICECC_ENV_EXEC ?= "${STAGING_BINDIR_NATIVE}/icecc-create-env"
HOSTTOOLS_NONFATAL += "icecc patchelf"
+BB_TASK_NETWORK ? = "1"
+
# This version can be incremented when changes are made to the environment that
# invalidate the version on the compile nodes. Changing it will cause a new
# environment to be created.
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index fba99e8f0c..bf5bcd5551 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -946,3 +946,6 @@ MULTILIB_VARIANTS ??= ""
# what it would be anyway if the signature generator (e.g. OEEquivHash) doesn't
# support unihashes.
BB_UNIHASH ?= "${BB_TASKHASH}"
+
+# Enable task network for remote user such as NIS.
+BB_TASK_NETWORK ??= "${@['1', '0'][oe.utils.is_local_uid()]}"
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 136650e6f7..c21f034aaf 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -595,3 +595,18 @@ def directory_size(root, blocksize=4096):
total += sum(roundup(getsize(os.path.join(root, name))) for name in files)
total += roundup(getsize(root))
return total
+
+def is_local_uid(uid=''):
+ """
+ Check whether uid is a local one or not.
+ Can't use pwd module since it gets all UIDs, not local ones only.
+ """
+ if not uid:
+ uid = os.getuid()
+ local_uids = set()
+ with open('/etc/passwd', 'r') as f:
+ for line in f.readlines():
+ if not ':' in line:
+ continue
+ local_uids.add(line.split(':')[2])
+ return uid in local_uids