* [meta-selinux][PATCH] busybox: Fix wrapper creation
@ 2024-03-22 15:54 Philip Lorenz
2024-03-24 11:26 ` Yi Zhao
0 siblings, 1 reply; 2+ messages in thread
From: Philip Lorenz @ 2024-03-22 15:54 UTC (permalink / raw
To: yocto; +Cc: Philip Lorenz, Joe MacDonald, Yi Zhao
`PACKAGEBUILDPKGD` was dropped in Yocto 4.2 and
`PACKAGE_PREPROCESS_FUNCS` should be used instead. The only requirement
for wrapper creation is that it is executed before any of the
`update-alternatives` hooks are executed. This continues to hold as the
call to `create_sh_wrapper_reset_alternative_vars` is prepended only
after the `update-alternatives` class has been inherited.
Additionally, this also fixes a race condition leading to
non-deterministic buildhistory entries in busybox's `sysroot` files.
The race condition was caused by the creation of the wrapper files
inside `D` (i.e. the image directory) which is also consumed by other
tasks such as `do_populate_sysroot` which may be executing in parallel
to `do_package`.
Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
---
recipes-core/busybox/busybox_selinux.inc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/recipes-core/busybox/busybox_selinux.inc b/recipes-core/busybox/busybox_selinux.inc
index ded8007..740980f 100644
--- a/recipes-core/busybox/busybox_selinux.inc
+++ b/recipes-core/busybox/busybox_selinux.inc
@@ -8,7 +8,7 @@ python create_sh_wrapper_reset_alternative_vars () {
# We need to load the full set of busybox provides from the /etc/busybox.links
# Use this to see the update-alternatives with the right information
- dvar = d.getVar('D')
+ dvar = d.getVar('PKGD')
pn = d.getVar('PN')
base_bindir = d.getVar('base_bindir')
@@ -55,9 +55,9 @@ python create_sh_wrapper_reset_alternative_vars () {
create_sh_alternative_vars("/etc/busybox.links.suid", "%s/busybox.suid" % base_bindir, 0o4755)
}
-# Add to PACKAGEBUILDPKGD so it could override the alternatives, which are set in
+# Add to PACKAGE_PREPROCESS_FUNCS so it could override the alternatives, which are set in
# do_package:prepend() section of busybox_*.bb.
-PACKAGEBUILDPKGD:prepend = "create_sh_wrapper_reset_alternative_vars "
+PACKAGE_PREPROCESS_FUNCS:prepend = "create_sh_wrapper_reset_alternative_vars "
# Use sh wrappers instead of links
pkg_postinst:${PN} () {
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [meta-selinux][PATCH] busybox: Fix wrapper creation
2024-03-22 15:54 [meta-selinux][PATCH] busybox: Fix wrapper creation Philip Lorenz
@ 2024-03-24 11:26 ` Yi Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Yi Zhao @ 2024-03-24 11:26 UTC (permalink / raw
To: Philip Lorenz, yocto, Doe, Joe
Looks good to me.
Thanks,
Yi
On 3/22/24 23:54, Philip Lorenz wrote:
> `PACKAGEBUILDPKGD` was dropped in Yocto 4.2 and
> `PACKAGE_PREPROCESS_FUNCS` should be used instead. The only requirement
> for wrapper creation is that it is executed before any of the
> `update-alternatives` hooks are executed. This continues to hold as the
> call to `create_sh_wrapper_reset_alternative_vars` is prepended only
> after the `update-alternatives` class has been inherited.
>
> Additionally, this also fixes a race condition leading to
> non-deterministic buildhistory entries in busybox's `sysroot` files.
> The race condition was caused by the creation of the wrapper files
> inside `D` (i.e. the image directory) which is also consumed by other
> tasks such as `do_populate_sysroot` which may be executing in parallel
> to `do_package`.
>
> Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
> ---
> recipes-core/busybox/busybox_selinux.inc | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/recipes-core/busybox/busybox_selinux.inc b/recipes-core/busybox/busybox_selinux.inc
> index ded8007..740980f 100644
> --- a/recipes-core/busybox/busybox_selinux.inc
> +++ b/recipes-core/busybox/busybox_selinux.inc
> @@ -8,7 +8,7 @@ python create_sh_wrapper_reset_alternative_vars () {
> # We need to load the full set of busybox provides from the /etc/busybox.links
> # Use this to see the update-alternatives with the right information
>
> - dvar = d.getVar('D')
> + dvar = d.getVar('PKGD')
> pn = d.getVar('PN')
> base_bindir = d.getVar('base_bindir')
>
> @@ -55,9 +55,9 @@ python create_sh_wrapper_reset_alternative_vars () {
> create_sh_alternative_vars("/etc/busybox.links.suid", "%s/busybox.suid" % base_bindir, 0o4755)
> }
>
> -# Add to PACKAGEBUILDPKGD so it could override the alternatives, which are set in
> +# Add to PACKAGE_PREPROCESS_FUNCS so it could override the alternatives, which are set in
> # do_package:prepend() section of busybox_*.bb.
> -PACKAGEBUILDPKGD:prepend = "create_sh_wrapper_reset_alternative_vars "
> +PACKAGE_PREPROCESS_FUNCS:prepend = "create_sh_wrapper_reset_alternative_vars "
>
> # Use sh wrappers instead of links
> pkg_postinst:${PN} () {
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-24 11:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-22 15:54 [meta-selinux][PATCH] busybox: Fix wrapper creation Philip Lorenz
2024-03-24 11:26 ` Yi Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).