* [OE-core][PATCH] classes/image: Add hooks
@ 2024-05-23 18:20 Joshua Watt
0 siblings, 0 replies; only message in thread
From: Joshua Watt @ 2024-05-23 18:20 UTC (permalink / raw)
To: openembedded-core; +Cc: Joshua Watt
Add variables to add arbitrary hooks into postfuncs and cleandirs. This
is required by SPDX to capture the files created in the image functions.
In addition, report the image type in a similar manner to subimages so
that the hooks can know the original image type
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
meta/classes-recipe/image.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 28be6c63623..f5c8c8caeee 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -351,6 +351,9 @@ python setup_debugfs () {
setup_debugfs_variables(d)
}
+IMAGE_TASK_POSTFUNCS ?= ""
+IMAGE_TASK_CLEANDIRS ?= ""
+
python () {
vardeps = set()
# We allow CONVERSIONTYPES to have duplicates. That avoids breaking
@@ -507,12 +510,15 @@ python () {
d.setVar(task, '\n'.join(cmds))
d.setVarFlag(task, 'func', '1')
d.setVarFlag(task, 'fakeroot', '1')
+ d.setVarFlag(task, 'imagetype', realt)
d.appendVarFlag(task, 'prefuncs', ' ' + debug + ' set_image_size')
d.prependVarFlag(task, 'postfuncs', 'create_symlinks ')
d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
d.appendVarFlag(task, 'vardepsexclude', ' DATETIME DATE ' + ' '.join(vardepsexclude))
+ d.appendVarFlag(task, 'postfuncs', ' ' + d.getVar("IMAGE_TASK_POSTFUNCS"))
+ d.appendVarFlag(task, 'cleandirs', ' ' + d.getVar("IMAGE_TASK_CLEANDIRS"))
bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
bb.build.addtask(task, 'do_image_complete', after, d)
--
2.43.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-23 18:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-23 18:20 [OE-core][PATCH] classes/image: Add hooks Joshua Watt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.