cpupower: Install systemd unit into systemd_system_unitdir

The kernel cpupower Makefile installs cpupower.service into a hardcoded
/usr/lib/systemd/system, while the systemd package ships
${systemd_unitdir}. On distros without usrmerge (e.g. poky) these
differ, and on sysvinit distros the unit is not wanted at all, causing
installed-vs-shipped QA errors.

Pass unitdir=${systemd_system_unitdir} so the unit lands where OE
expects, and set SYSTEMD=false when systemd is not in DISTRO_FEATURES
so the unit is not installed.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-11-11 18:20:13 -08:00
1 parent 26c1d52acb
commit 1fe53601f7
1 file changed
+4 -2
+4 -2
View File
@@ -11,7 +11,9 @@ inherit kernelsrc kernel-arch bash-completion
do_populate_lic[depends] += "virtual/kernel:do_shared_workdir"
EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH}"
EXTRA_OEMAKE = "-C ${S}/tools/power/cpupower O=${B} CROSS=${TARGET_PREFIX} CC="${CC}" LD="${LD}" AR=${AR} ARCH=${ARCH} \
unitdir=${systemd_system_unitdir} \
SYSTEMD=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
do_configure[depends] += "virtual/kernel:do_shared_workdir"
@@ -27,7 +29,7 @@ do_install() {
PACKAGE_ARCH = "${MACHINE_ARCH}"
PACKAGES =+ "${PN}-systemd"
FILES:${PN}-systemd = "${sysconfdir}/cpupower-service.conf ${systemd_unitdir}"
FILES:${PN}-systemd = "${sysconfdir}/cpupower-service.conf ${systemd_system_unitdir}"
RDEPENDS:${PN} = "bash"