diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2017-01-13 15:23:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-01-20 11:53:48 +0000 |
commit | 3ba8917c4d890a1fdd3ffb250fe3ef73557542f5 (patch) | |
tree | c1752528dbc96940d9b3d2a3c0eea8c5ca8a1e9b /meta | |
parent | bf0ea57e4a5dc5f47b2fb7623c3cea9a3ae7e4cb (diff) | |
download | poky-3ba8917c4d890a1fdd3ffb250fe3ef73557542f5.tar.gz |
rm_work.bbclass: allow preserving additional content
By default, do_rm_work either skips recipes entirely (when listed in
RM_WORK_EXCLUDE) or removes everything except for temp.
In meta-swupd, virtual image recipes collaborate on producing update
data for the base recipe. Tasks running in the base recipe need some
information from the virtual images.
Those files could be passed via a new shared work directory, but that
scatters data in even more places. It's simpler to use the normal
WORKDIR and teach rm_work.bbclass to not remove the special output
with the new RM_WORK_EXCLUDE_ITEMS.
(From OE-Core rev: 28fbb2dd17033308cc09811fbc4f43e2f6c17f54)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/rm_work.bbclass | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index 3516c7edf8..9b7220fc2b 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass | |||
@@ -10,6 +10,14 @@ | |||
10 | # | 10 | # |
11 | # RM_WORK_EXCLUDE += "icu-native icu busybox" | 11 | # RM_WORK_EXCLUDE += "icu-native icu busybox" |
12 | # | 12 | # |
13 | # Recipes can also configure which entries in their ${WORKDIR} | ||
14 | # are preserved besides temp, which already gets excluded by default | ||
15 | # because it contains logs: | ||
16 | # do_install_append () { | ||
17 | # echo "bar" >${WORKDIR}/foo | ||
18 | # } | ||
19 | # RM_WORK_EXCLUDE_ITEMS += "foo" | ||
20 | RM_WORK_EXCLUDE_ITEMS = "temp" | ||
13 | 21 | ||
14 | # Use the completion scheduler by default when rm_work is active | 22 | # Use the completion scheduler by default when rm_work is active |
15 | # to try and reduce disk usage | 23 | # to try and reduce disk usage |
@@ -37,7 +45,7 @@ do_rm_work () { | |||
37 | # failures of removing pseudo folers on NFS2/3 server. | 45 | # failures of removing pseudo folers on NFS2/3 server. |
38 | if [ $dir = 'pseudo' ]; then | 46 | if [ $dir = 'pseudo' ]; then |
39 | rm -rf $dir 2> /dev/null || true | 47 | rm -rf $dir 2> /dev/null || true |
40 | elif [ $dir != 'temp' ]; then | 48 | elif ! echo '${RM_WORK_EXCLUDE_ITEMS}' | grep -q -w "$dir"; then |
41 | rm -rf $dir | 49 | rm -rf $dir |
42 | fi | 50 | fi |
43 | done | 51 | done |