Skip to contentSkip to conversation

image.bbclass: use prependVarFlag for postfuncs

PATCH New Ed Bartosh 1 participant 1 message Jun 16, 2017

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 image.bbclass: use prependVarFlag for postfuncs

It would be possible to achieve any order of calling functions if prefuncs are added with appendVarFlag and postfuncs with prependVarFlag. Then image_X.bbclass can add code with either pre/post-funcs or do_image_x_append or _prepend.

The execution order would be:

image_X prefuncs
image prefuncs
do_image_X_prepend from image_X.bbclass
do_image_X from image.bbclass
do_image_X_append from image_X.bbclass
image postfuncs
image_X postfuncs

[YOCTO #11372]

Thanks to Ola Nillsson for the idea.

---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/image.bbclass +1 -1
index 9a04b43..be8c9dd 100644
@@ -498,7 +498,7 @@ python () {
         d.setVarFlag(task, 'fakeroot', '1')
 
         d.appendVarFlag(task, 'prefuncs', ' ' + debug + ' set_image_size')
-        d.appendVarFlag(task, 'postfuncs', ' create_symlinks')
+        d.prependVarFlag(task, 'postfuncs', ' create_symlinks')
         d.appendVarFlag(task, 'subimages', ' ' + ' '.join(subimages))
         d.appendVarFlag(task, 'vardeps', ' ' + ' '.join(vardeps))
         d.appendVarFlag(task, 'vardepsexclude', 'DATETIME')
Signature · 1 line
2.1.4