diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-25 22:15:53 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-25 19:55:54 +0100 |
commit | 10d61b276d4ffc65640a862c7e5b5852a5716813 (patch) | |
tree | bd82db8cd81ffb4f6bb2620b4f56ddc67e471a69 /bin | |
parent | 3fbc46735ee3679ef1b7466810e4345d78ed05ea (diff) | |
download | bitbake-10d61b276d4ffc65640a862c7e5b5852a5716813.tar.gz |
bitbake-worker: Handle pseudo shutdown in Ctrl+C case
If the build is interrupted, handle the shutdown of pseudo even in this
case to avoid data corruption inside docker containers.
[YOCTO #14555]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a2a04c6fe94bc56efcff299c669a151746e35916)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bitbake-worker | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/bitbake-worker b/bin/bitbake-worker index b3877b15c..4318ce611 100755 --- a/bin/bitbake-worker +++ b/bin/bitbake-worker @@ -286,10 +286,12 @@ def fork_off_task(cfg, data, databuilder, workerdata, fn, task, taskname, taskha try: if dry_run: return 0 - 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) + try: + ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile) + finally: + if fakeroot: + fakerootcmd = shlex.split(the_data.getVar("FAKEROOTCMD")) + subprocess.run(fakerootcmd + ['-S'], check=True, stdout=subprocess.PIPE) return ret except: os._exit(1) |