aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2022-01-20 22:52:55 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-02-01 07:31:37 +0000
commit4eafae7904bae6e5c6bc50356e8a9077f2e207fa (patch)
tree7b2e68aad0449ffd4bc17bd3280431fb0a595693 /bin
parent1f06f326fa8b47e2a4dce756d57a9369a2225201 (diff)
downloadbitbake-4eafae7904bae6e5c6bc50356e8a9077f2e207fa.tar.gz
bitbake: bitbake-worker: Preserve network non-local uid
The NIS can't work when network is dissable, so preserve network for it, the error is like: do_ypcall: clnt_call: RPC: Unable to send; errno = Network is unreachable Note, enable nscd on the build machine might be a solution, but that isn't reliable since it depends on whether the network function has been cached or not. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bitbake-worker7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker
index 3aaf3c244..063cf3792 100755
--- a/bin/bitbake-worker
+++ b/bin/bitbake-worker
@@ -262,8 +262,11 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
bb.utils.set_process_name("%s:%s" % (the_data.getVar("PN"), taskname.replace("do_", "")))
if not the_data.getVarFlag(taskname, 'network', False):
- logger.debug("Attempting to disable network")
- bb.utils.disable_network(uid, gid)
+ if bb.utils.is_local_uid(uid):
+ logger.debug("Attempting to disable network for %s" % taskname)
+ bb.utils.disable_network(uid, gid)
+ else:
+ logger.debug("Skipping disable network for %s since %s is not a local uid." % (taskname, uid))
# exported_vars() returns a generator which *cannot* be passed to os.environ.update()
# successfully. We also need to unset anything from the environment which shouldn't be there