* [OE-core][master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook
@ 2026-06-18 8:10 AshishKumar Mishra
2026-06-19 6:33 ` [master][PATCH] " AshishKumar Mishra
2026-06-29 6:29 ` [OE-core][master][PATCH] " Richard Purdie
0 siblings, 2 replies; 4+ messages in thread
From: AshishKumar Mishra @ 2026-06-18 8:10 UTC (permalink / raw)
To: openembedded-core; +Cc: AshishKumar Mishra
From: AshishKumar Mishra <emailaddress.ashish@gmail.com>
This patch adds a new hook point PACKAGE_POSTPROCESS_FUNCS to
package.bbclass, inserted into PACKAGEFUNCS immediately before
emit_pkgdata.
PACKAGE_PREPROCESS_FUNCS comes in picture before the per-package file split,
so at that point the final file lists are not yet available.
There is no existing hook that fires after the split with the ability to still
modify package scripts postinst
The primary use case driving this patch is SELinux context labeling
SELinux labels must be applied on the target via a postinst script
That script must know exactly which files are in the package but this is
only available after the split.
This hook enables a bbclass to auto-generate per-package postinst
scripts containing targeted chcon/restorecon calls
This helps while getting proper selinux context to files if package
is updated on target while incremental update scenarios
There can be other user defined usage if the hook is available
The change is small 2 lines and entirely non-breaking as the variable
defaults to "" so all existing builds are unaffected
Signed-off-by: AshishKumar Mishra <emailaddress.ashish@gmail.com>
---
meta/classes-global/package.bbclass | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/classes-global/package.bbclass b/meta/classes-global/package.bbclass
index 30accaeaa9..37e4469bc8 100644
--- a/meta/classes-global/package.bbclass
+++ b/meta/classes-global/package.bbclass
@@ -460,6 +460,7 @@ def gen_packagevar(d, pkgvars="PACKAGEVARS"):
# Functions for setting up PKGD
PACKAGE_PREPROCESS_FUNCS ?= ""
+PACKAGE_POSTPROCESS_FUNCS ?= ""
# Functions which split PKGD up into separate packages
PACKAGESPLITFUNCS ?= " \
package_do_split_locales \
@@ -473,6 +474,7 @@ PACKAGEFUNCS += " \
package_do_pkgconfig \
read_shlibdeps \
package_depchains \
+ ${PACKAGE_POSTPROCESS_FUNCS} \
emit_pkgdata"
python do_package () {
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook
2026-06-18 8:10 [OE-core][master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook AshishKumar Mishra
@ 2026-06-19 6:33 ` AshishKumar Mishra
2026-06-29 5:14 ` AshishKumar Mishra
2026-06-29 6:29 ` [OE-core][master][PATCH] " Richard Purdie
1 sibling, 1 reply; 4+ messages in thread
From: AshishKumar Mishra @ 2026-06-19 6:33 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 163 bytes --]
Hi Team,
Can team take this for master-next branch
If team has any review comments, do let me know i can rework on that patch accordingly
Thanks ,
Ashish
[-- Attachment #2: Type: text/html, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core][master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook
2026-06-18 8:10 [OE-core][master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook AshishKumar Mishra
2026-06-19 6:33 ` [master][PATCH] " AshishKumar Mishra
@ 2026-06-29 6:29 ` Richard Purdie
1 sibling, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2026-06-29 6:29 UTC (permalink / raw)
To: emailaddress.ashish, openembedded-core
On Thu, 2026-06-18 at 13:40 +0530, Ashish Mishra via lists.openembedded.org wrote:
> From: AshishKumar Mishra <emailaddress.ashish@gmail.com>
>
> This patch adds a new hook point PACKAGE_POSTPROCESS_FUNCS to
> package.bbclass, inserted into PACKAGEFUNCS immediately before
> emit_pkgdata.
>
> PACKAGE_PREPROCESS_FUNCS comes in picture before the per-package file split,
> so at that point the final file lists are not yet available.
> There is no existing hook that fires after the split with the ability to still
> modify package scripts postinst
>
> The primary use case driving this patch is SELinux context labeling
> SELinux labels must be applied on the target via a postinst script
> That script must know exactly which files are in the package but this is
> only available after the split.
> This hook enables a bbclass to auto-generate per-package postinst
> scripts containing targeted chcon/restorecon calls
> This helps while getting proper selinux context to files if package
> is updated on target while incremental update scenarios
>
> There can be other user defined usage if the hook is available
> The change is small 2 lines and entirely non-breaking as the variable
> defaults to "" so all existing builds are unaffected
The trouble is that this is only going to work as long as it is only
your use case using this function name. As soon as someone else decides
their function should be last, it will break your use case.
I guess we could hardcode the emit_pkgdata which would give you access
to the end of the list of functions?
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-29 6:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 8:10 [OE-core][master][PATCH] package.bbclass: add PACKAGE_POSTPROCESS_FUNCS hook AshishKumar Mishra
2026-06-19 6:33 ` [master][PATCH] " AshishKumar Mishra
2026-06-29 5:14 ` AshishKumar Mishra
2026-06-29 6:29 ` [OE-core][master][PATCH] " Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox