Skip to contentSkip to conversation

cpupower: Install systemd unit into systemd_system_unitdir

PATCH New Khem Raj 1 participant 1 message Nov 12

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 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.

---
 meta-oe/recipes-kernel/cpupower/cpupower.bb | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta-oe/recipes-kernel/cpupower/cpupower.bb +4 -2
index b453308770..a8cdf1bf0a 100644
@@ -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"