Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] rm_work.bbclass: allow preserving additional content
@ 2017-01-13 14:23 Patrick Ohly
  2017-01-13 15:05 ` Patrick Ohly
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Ohly @ 2017-01-13 14:23 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
---
 meta/classes/rm_work.bbclass | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 64b6981..1ec63b4 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -10,6 +10,14 @@
 #
 # RM_WORK_EXCLUDE += "icu-native icu busybox"
 #
+# Recipes can also configure which entries in their ${WORKDIR}
+# are preserved besides temp, which already gets excluded by default
+# because it contains logs:
+# do_install_append () {
+#     echo "bar" >${WORKDIR}/foo
+# }
+# RM_WORK_EXCLUDE_ITEMS += "foo"
+RM_WORK_EXCLUDE_ITEMS = "temp"
 
 # Use the completion scheduler by default when rm_work is active
 # to try and reduce disk usage
@@ -37,7 +45,7 @@ do_rm_work () {
         # failures of removing pseudo folers on NFS2/3 server.
         if [ $dir = 'pseudo' ]; then
             rm -rf $dir 2> /dev/null || true
-        elif [ $dir != 'temp' ]; then
+        elif ! echo '${RM_WORK_EXCLUDE_ITEMS}' | grep -q -w "$dir"; then
             rm -rf $dir
         fi
     done
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] rm_work.bbclass: allow preserving additional content
  2017-01-13 14:23 [PATCH 1/2] rm_work.bbclass: allow preserving additional content Patrick Ohly
@ 2017-01-13 15:05 ` Patrick Ohly
  0 siblings, 0 replies; 2+ messages in thread
From: Patrick Ohly @ 2017-01-13 15:05 UTC (permalink / raw)
  To: openembedded-core

Hello!

Please ignored the 1/2 in the subject. There's just one patch for
OE-core, the other one I had locally needs to go into meta-swupd.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-13 15:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-13 14:23 [PATCH 1/2] rm_work.bbclass: allow preserving additional content Patrick Ohly
2017-01-13 15:05 ` Patrick Ohly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox