scarthgap: auditd recipe broken when systemd is enabled
Opened this issue · 2 comments
embetrix commented
ERROR: audit-4.0.1-r0 do_package: Didn't find service unit 'auditd.service', specified in SYSTEMD_SERVICE:auditd.
ERROR: Logfile of failure stored in: /workspaces/meta-ozyx/build/tmp/work/core2-32-ozyx-linux/audit/4.0.1/temp/log.do_package.2949105
ERROR: Task (/workspaces/meta-example/build/../layers/meta-openembedded/meta-oe/recipes-security/audit/audit_4.0.1.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 6613 tasks of which 4859 didn't need to be rerun and 1 failed.
embetrix commented
the unit files install step is missing:
do_install:append() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${B}/init.d/auditd.service ${D}${systemd_unitdir}/system/
install -m 0644 ${B}/init.d/audit-rules.service ${D}${systemd_unitdir}/system/
}
pityhelplessnessandfat commented
The following modifications need to be add.
If a DISTRO_FEATURES
of project contains sysvinit
and systemd
, ${D}${libdir}/systemd
will be deleted. Error.
So if DISTRO_FEATURES
contains sysvinit
and systemd
, don't delete them.
if DISTRO_FEATURES
only contains sysvinit
, it will carry auditd.service
and audit-rules.service
to ${D}${libdir}.
If don't delte them, yocto print error log.
ERROR: audit-4.0.1-r0 do_package: QA Issue: audit: Files/directories were installed but not shipped in any package:
So if DISTRO_FEATURES
only contains sysvinit
, delete them.
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -D -m 0755 ${WORKDIR}/auditd ${D}/etc/init.d/auditd
- rm -rf ${D}${libdir}/systemd
+
+ if ! ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ rm -rf ${D}${libdir}/systemd
+ fi
+
`fi`