systemd.bbclass creates all presets in ${systemd_unitdir}/system-preset where presets for user services should be created in ${systemd_unitdir}/user-preset instead. An example recipe SUMMARY = "Bug reproduction" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" do_configure[noexec] = "1" do_compile[noexec] = "1" inherit allarch systemd SYSTEMD_PACKAGES = "${PN}" SYSTEMD_SERVICE:${PN} = "test-service.service" do_install() { install -d ${D}${systemd_user_unitdir} cat <<EOF > ${D}${systemd_user_unitdir}/test-service.service [Unit] Description=Test [Service] ExecStart=${bindir}/true EOF } Results in ./usr ./usr/lib ./usr/lib/systemd ./usr/lib/systemd/user ./usr/lib/systemd/user/test-service.service ./usr/lib/systemd/system-preset ./usr/lib/systemd/system-preset/98-do-something.preset In effect, this causes image build to fail if broken package is included: ERROR: core-image-minimal-1.0-r0 do_rootfs: Error: Systemctl main enable issue in test-service.service (test-service.service)
Artur, are you willing and able to send a patch? Even adding a readable error message would help.
Fix is underway, I will provide patches in a day or two.
Patches sent: https://patchwork.yoctoproject.org/project/oe-core/list/?series=30672
Merged 8 commits, the most recent of which was: https://git.openembedded.org/openembedded-core/commit/?id=ce62b88d8f71368e356b6409ada46a34a6017ddf Thanks Artur!