Skip to contentSkip to conversation

lmsensors: add a PACKAGECONFIG for sensord

PATCH New Dan Callaghan 1 participant 1 message Sep 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lmsensors: add a PACKAGECONFIG for sensord

We don't install the lmsensors-sensord subpackage in our images, but our build process still has to build the subpackage and all its dependencies, including rrdtool.

Adding a PACKAGECONFIG for sensord lets us entirely avoid building rrdtool and its dependency chain, which reduces our image build process by 141 tasks.

---
 .../lm_sensors/lmsensors-config_1.0.bb        | 23 +++++++----
 .../recipes-bsp/lm_sensors/lmsensors_3.5.0.bb | 41 ++++++++++++++-----
 2 files changed, 44 insertions(+), 20 deletions(-)
meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb +14 -9
index b0091d657..b55bd5161 100644
@@ -14,6 +14,9 @@ SRC_URI = "file://fancontrol \
 "
 S = "${WORKDIR}"
 
+PACKAGECONFIG ??= "sensord"
+PACKAGECONFIG[sensord] = ",,"
+
 RDEPENDS_${PN}-dev = ""
 
 do_install() {
@@ -25,27 +28,29 @@ do_install() {
     install -d ${D}${sysconfdir}/sensors.d
     install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d
 
-    # Install sensord configuration file
-    install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir}
+    if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
+        # Install sensord configuration file
+        install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir}
 
-    # Install sensord.cgi script and create world-writable
-    # web-accessible sensord directory
-    install -d ${D}/www/pages/cgi-bin
-    install -m 0755 ${WORKDIR}/sensord.cgi ${D}/www/pages/cgi-bin
-    install -d -m a=rwxs ${D}/www/pages/sensord
+        # Install sensord.cgi script and create world-writable
+        # web-accessible sensord directory
+        install -d ${D}/www/pages/cgi-bin
+        install -m 0755 ${WORKDIR}/sensord.cgi ${D}/www/pages/cgi-bin
+        install -d -m a=rwxs ${D}/www/pages/sensord
+    fi
 }
 
 # libsensors configuration
 PACKAGES =+ "${PN}-libsensors"
 
 # sensord logging daemon configuration
-PACKAGES =+ "${PN}-sensord"
+PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)}"
 
 # fancontrol script configuration
 PACKAGES =+ "${PN}-fancontrol"
 
 # sensord web cgi support
-PACKAGES =+ "${PN}-cgi"
+PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-cgi', '', d)}"
 RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi"
 RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool"
 FILES_${PN}-cgi = "/www/*"
meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb +30 -11

76 lines not on this page · raw message

Signature · 1 line
2.20.1