Hi Lukasz,
I tried locally and you are right, we need to switch to the inherit_defer.
The below patch adds the privdrop PACKAGECONFIG and changes the class to
useradd_.
Parsing the recipe with "bitbake -p chrony" will rise an error: Could not
inherit file classes/useradd_.bbclass
But this only happens with the inherit_defer, with just the inherit and the
same useradd_ bbclass the error is not detected
--- a/meta-networking/recipes-support/chrony/chrony_4.5.bb
+++ b/meta-networking/recipes-support/chrony/chrony_4.5.bb
@@ -48,7 +48,7 @@ DEPENDS = "pps-tools"
inherit update-rc.d systemd pkgconfig
# Add chronyd user if privdrop packageconfig is selected
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '',
d)}
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'privdrop',
'useradd_', '', d)}
USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop',
'${PN}', '', d)}"
USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop',
'--system -d / -M --shell /bin/nologin chronyd;', '', d)}"
@@ -61,6 +61,7 @@ USERADD_PARAM:${PN} +=
"${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--sys
# kernel to have CONFIG_SECCOMP enabled.
PACKAGECONFIG ??= "editline \
${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+ privdrop \
"
PACKAGECONFIG[editline] = ",--without-editline,libedit"
PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss"
On the meta-openembedded scarthgap layer there are still quite a few
'inherit' to be converted to 'inherit_defer' as you pointed out,
patches are welcome to fix all of this:
$ grep -r 'inherit ' | grep -e '\$' -e '@' | cut -d':' -f1
meta-gnome/classes/clutter.bbclass
meta-multimedia/recipes-multimedia/vlc/vlc_3.0.20.bb
meta-networking/recipes-connectivity/networkmanager/networkmanager_1.46.0.bb
meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
meta-networking/recipes-protocols/openlldp/openlldp_1.1.1.bb
meta-networking/recipes-support/chrony/chrony_4.5.bb
meta-networking/recipes-support/wireshark/wireshark_4.2.4.bb
meta-oe/recipes-connectivity/telepathy/telepathy-idle_0.2.0.bb
meta-oe/recipes-connectivity/modemmanager/modemmanager_1.22.0.bb
meta-oe/recipes-dbs/mysql/mysql-python_1.2.5.bb
meta-oe/recipes-extended/openlmi/openlmi-tools_0.10.5.bb
meta-oe/recipes-extended/wxwidgets/wxwidgets_3.2.1.bb
meta-oe/recipes-support/lio-utils/lio-utils_4.1.bb
meta-oe/recipes-support/poppler/poppler_23.04.0.bb
meta-webserver/recipes-httpd/cherokee/cherokee_git.bb
meta-webserver/recipes-webadmin/cockpit/cockpit_304.bb
Jose
Lukasz Zemla via Lists.Yoctoproject.Org <lukasz.zemla=
[email protected]> escreveu (segunda, 17/06/2024 à(s)
18:34):
> Hello Jose,
>
> > There is an extra space missing in before the privdrop, the :append
> override does not add the extra space.
> > Can you try with: PACKAGECONFIG:append = " privdrop" ?
> > Jose
>
> I apologize - I wanted my mail to bo compacted, so I just typed that
> expression manually. In practice my recipe contains:
>
> PACKAGECONFIG:append = " \
> privdrop \
> "
>
> I does not work. I am more and more convinced that enumerated by me
> recipes should be modified (inherit -> inherit_defer). For example, I can
> see the following commit in the meta-openembedded master branch which
> addresses nftables:
>
> commit 5cf3766cf6395d4bfa5de20cf7427950ca498eaa
> Author: Michael Olbrich <[email protected]>
> Date: Wed May 29 11:58:51 2024 +0200
>
> nftables: avoid python dependencies when building without python
>
> Use inherit_defer instead of inhert. This way, setuptools3 is not
> inherited when python is removed from PACKAGECONFIG in a .bbappend
> file.
> This avoids dependencies added by setuptools3.
>
> Don't add nftables-python to PACKAGES if python is disabled. It adds
> extra runtime dependencies on python3-core and python3-json.
>
> Signed-off-by: Michael Olbrich <[email protected]>
> Signed-off-by: Khem Raj <[email protected]>
>
> diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
> b/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
> index 7718922742..17f00ffd42 100644
> --- a/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
> +++ b/meta-networking/recipes-filter/nftables/nftables_1.0.9.bb
> @@ -35,9 +35,9 @@ EXTRA_OECONF = " \
>
> SETUPTOOLS_SETUP_PATH = "${S}/py"
>
> -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3',
> '', d)}
> +inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python',
> 'setuptools3', '', d)}
>
> -PACKAGES =+ "${PN}-python"
> +PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'python',
> '${PN}-python', '', d)}"
> FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
> RDEPENDS:${PN}-python = "python3-core python3-json ${PN}"
>
>
>
> Best regards,
> Lukasz Zemla
>
--
Best regards,
José Quaresma
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#63356): https://lists.yoctoproject.org/g/yocto/message/63356
Mute This Topic: https://lists.yoctoproject.org/mt/106724990/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-