Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scarthgap: auditd recipe broken when systemd is enabled #826

Open
embetrix opened this issue May 17, 2024 · 2 comments
Open

scarthgap: auditd recipe broken when systemd is enabled #826

embetrix opened this issue May 17, 2024 · 2 comments

Comments

@embetrix
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link

pityhelplessnessandfat commented Jun 28, 2024

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`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants