diff options
author | Philip Lorenz <philip.lorenz@bmw.de> | 2024-03-22 16:54:12 +0100 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2024-03-28 10:01:42 -0400 |
commit | 5006df61371188221b82807339f9217b331fc7a1 (patch) | |
tree | dff43b39629f5f0862a33a932cdfac63e9399f91 | |
parent | b1eddc23d6b46a403bd1548a98512b69e5ecbd7e (diff) | |
download | meta-selinux-5006df61371188221b82807339f9217b331fc7a1.tar.gz |
busybox: Fix wrapper creation
`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>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-core/busybox/busybox_selinux.inc | 6 |
1 files 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 () { | |||
8 | # We need to load the full set of busybox provides from the /etc/busybox.links | 8 | # We need to load the full set of busybox provides from the /etc/busybox.links |
9 | # Use this to see the update-alternatives with the right information | 9 | # Use this to see the update-alternatives with the right information |
10 | 10 | ||
11 | dvar = d.getVar('D') | 11 | dvar = d.getVar('PKGD') |
12 | pn = d.getVar('PN') | 12 | pn = d.getVar('PN') |
13 | base_bindir = d.getVar('base_bindir') | 13 | base_bindir = d.getVar('base_bindir') |
14 | 14 | ||
@@ -55,9 +55,9 @@ python create_sh_wrapper_reset_alternative_vars () { | |||
55 | create_sh_alternative_vars("/etc/busybox.links.suid", "%s/busybox.suid" % base_bindir, 0o4755) | 55 | create_sh_alternative_vars("/etc/busybox.links.suid", "%s/busybox.suid" % base_bindir, 0o4755) |
56 | } | 56 | } |
57 | 57 | ||
58 | # Add to PACKAGEBUILDPKGD so it could override the alternatives, which are set in | 58 | # Add to PACKAGE_PREPROCESS_FUNCS so it could override the alternatives, which are set in |
59 | # do_package:prepend() section of busybox_*.bb. | 59 | # do_package:prepend() section of busybox_*.bb. |
60 | PACKAGEBUILDPKGD:prepend = "create_sh_wrapper_reset_alternative_vars " | 60 | PACKAGE_PREPROCESS_FUNCS:prepend = "create_sh_wrapper_reset_alternative_vars " |
61 | 61 | ||
62 | # Use sh wrappers instead of links | 62 | # Use sh wrappers instead of links |
63 | pkg_postinst:${PN} () { | 63 | pkg_postinst:${PN} () { |