summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-14 11:35:21 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-16 11:26:11 +0000
commitf4fb74465787b50030d7fed5e0b293774ccb371b (patch)
tree36705ddb807cfec20c691c5da0a7e3abcfa07479 /bitbake
parent8b792d4f75b451f9e08fdb13464a0b66c11bc075 (diff)
downloadpoky-f4fb74465787b50030d7fed5e0b293774ccb371b.tar.gz
bitbake: bitbake-worker/runqueue: Add support for BB_DEFAULT_UMASK
Currently each task has to have a umask specified individually. This is leading to determinism issues since it is easy to miss specifying this for an extra task. Add support for specifing the default task umask globally which simplifies the problem. (Bitbake rev: 3e664599fd54a8a37ce587022fcbce5ca26f2ed3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/bin/bitbake-worker8
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst4
-rw-r--r--bitbake/lib/bb/runqueue.py1
3 files changed, 11 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 6c37967513..7765b9368b 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -150,11 +150,15 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha
150 150
151 taskdep = workerdata["taskdeps"][fn] 151 taskdep = workerdata["taskdeps"][fn]
152 if 'umask' in taskdep and taskname in taskdep['umask']: 152 if 'umask' in taskdep and taskname in taskdep['umask']:
153 umask = taskdep['umask'][taskname]
154 elif workerdata["umask"]:
155 umask = workerdata["umask"]
156 if umask:
153 # umask might come in as a number or text string.. 157 # umask might come in as a number or text string..
154 try: 158 try:
155 umask = int(taskdep['umask'][taskname],8) 159 umask = int(umask, 8)
156 except TypeError: 160 except TypeError:
157 umask = taskdep['umask'][taskname] 161 pass
158 162
159 dry_run = cfg.dry_run or dry_run_exec 163 dry_run = cfg.dry_run or dry_run_exec
160 164
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
index 74a3eb8095..6469f9d1a4 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst
@@ -108,6 +108,10 @@ overview of their function and contents.
108 command line option). The task name specified should not include the 108 command line option). The task name specified should not include the
109 ``do_`` prefix. 109 ``do_`` prefix.
110 110
111 :term:`BB_DEFAULT_UMASK`
112 The default umask to apply to tasks if specified and no task specific
113 umask flag is set.
114
111 :term:`BB_DISKMON_DIRS` 115 :term:`BB_DISKMON_DIRS`
112 Monitors disk space and available inodes during the build and allows 116 Monitors disk space and available inodes during the build and allows
113 you to control the build based on these parameters. 117 you to control the build based on these parameters.
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b8b217c64a..54ef245a63 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1271,6 +1271,7 @@ class RunQueue:
1271 "date" : self.cfgData.getVar("DATE"), 1271 "date" : self.cfgData.getVar("DATE"),
1272 "time" : self.cfgData.getVar("TIME"), 1272 "time" : self.cfgData.getVar("TIME"),
1273 "hashservaddr" : self.cooker.hashservaddr, 1273 "hashservaddr" : self.cooker.hashservaddr,
1274 "umask" : self.cfgData.getVar("BB_DEFAULT_UMASK"),
1274 } 1275 }
1275 1276
1276 worker.stdin.write(b"<cookerconfig>" + pickle.dumps(self.cooker.configuration) + b"</cookerconfig>") 1277 worker.stdin.write(b"<cookerconfig>" + pickle.dumps(self.cooker.configuration) + b"</cookerconfig>")