diff mbox series

[meta-oe] cpupower: Install systemd unit into systemd_system_unitdir

Message ID 20261112001956.1124296-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe] cpupower: Install systemd unit into systemd_system_unitdir | expand

Commit Message

Khem Raj Nov. 12, 2026, 12:19 a.m. UTC
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>
---
 meta-oe/recipes-kernel/cpupower/cpupower.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-kernel/cpupower/cpupower.bb b/meta-oe/recipes-kernel/cpupower/cpupower.bb
index b453308770..a8cdf1bf0a 100644
--- a/meta-oe/recipes-kernel/cpupower/cpupower.bb
+++ b/meta-oe/recipes-kernel/cpupower/cpupower.bb
@@ -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"