chrony: use inherit_defer for conditional inherit of useradd

conditionnal inherit is missed when PACKAGECONFIG privdrop is
activated after this inherit, eg in .bbappend.

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Andreas Fenkart 2025-04-17 15:53:22 +02:00 committed by Khem Raj
parent b7ec477640
commit 63df976d8e
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -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 /sbin/nologin chronyd;', '', d)}"