diff options
Diffstat (limited to 'poky/bitbake/bin/bitbake-worker')
-rwxr-xr-x | poky/bitbake/bin/bitbake-worker | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/poky/bitbake/bin/bitbake-worker b/poky/bitbake/bin/bitbake-worker index 6ead2da6d..115bc1d09 100755 --- a/poky/bitbake/bin/bitbake-worker +++ b/poky/bitbake/bin/bitbake-worker @@ -17,6 +17,8 @@ import signal import pickle import traceback import queue +import shlex +import subprocess from multiprocessing import Lock from threading import Thread @@ -146,6 +148,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha # a fork() or exec*() activates PSEUDO... envbackup = {} + fakeroot = False fakeenv = {} umask = None @@ -165,6 +168,7 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha # We can't use the fakeroot environment in a dry run as it possibly hasn't been built if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not dry_run: + fakeroot = True envvars = (workerdata["fakerootenv"][fn] or "").split() for key, value in (var.split('=') for var in envvars): envbackup[key] = os.environ.get(key) @@ -283,7 +287,11 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha try: if dry_run: return 0 - return bb.build.exec_task(fn, taskname, the_data, cfg.profile) + ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile) + if fakeroot: + fakerootcmd = shlex.split(the_data.getVar("FAKEROOTCMD")) + subprocess.run(fakerootcmd + ['-S'], check=True, stdout=subprocess.PIPE) + return ret except: os._exit(1) if not profiling: |