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.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Callaghan, Dan
2019-09-16 10:28:11 +10:00
committed by Khem Raj
parent 9b2a48016a
commit df10367ebd
2 changed files with 44 additions and 20 deletions
@@ -14,6 +14,9 @@ SRC_URI = "file://fancontrol \
" "
S = "${WORKDIR}" S = "${WORKDIR}"
PACKAGECONFIG ??= "sensord"
PACKAGECONFIG[sensord] = ",,"
RDEPENDS_${PN}-dev = "" RDEPENDS_${PN}-dev = ""
do_install() { do_install() {
@@ -25,27 +28,29 @@ do_install() {
install -d ${D}${sysconfdir}/sensors.d install -d ${D}${sysconfdir}/sensors.d
install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d
# Install sensord configuration file if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir} # Install sensord configuration file
install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir}
# Install sensord.cgi script and create world-writable # Install sensord.cgi script and create world-writable
# web-accessible sensord directory # web-accessible sensord directory
install -d ${D}/www/pages/cgi-bin install -d ${D}/www/pages/cgi-bin
install -m 0755 ${WORKDIR}/sensord.cgi ${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 -d -m a=rwxs ${D}/www/pages/sensord
fi
} }
# libsensors configuration # libsensors configuration
PACKAGES =+ "${PN}-libsensors" PACKAGES =+ "${PN}-libsensors"
# sensord logging daemon configuration # sensord logging daemon configuration
PACKAGES =+ "${PN}-sensord" PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)}"
# fancontrol script configuration # fancontrol script configuration
PACKAGES =+ "${PN}-fancontrol" PACKAGES =+ "${PN}-fancontrol"
# sensord web cgi support # sensord web cgi support
PACKAGES =+ "${PN}-cgi" PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-cgi', '', d)}"
RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi" RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi"
RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool" RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool"
FILES_${PN}-cgi = "/www/*" FILES_${PN}-cgi = "/www/*"
@@ -23,14 +23,26 @@ inherit update-rc.d systemd
RDEPENDS_${PN}-dev = "" RDEPENDS_${PN}-dev = ""
INITSCRIPT_PACKAGES = "${PN}-fancontrol ${PN}-sensord" PACKAGECONFIG ??= "sensord"
PACKAGECONFIG[sensord] = "sensord,,rrdtool"
INITSCRIPT_PACKAGES = "\
${PN}-fancontrol \
${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)} \
"
INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol" INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol"
INITSCRIPT_NAME_${PN}-sensord = "sensord" INITSCRIPT_NAME_${PN}-sensord = "sensord"
INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66"
INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67"
SYSTEMD_PACKAGES = "${PN}-sensord" SYSTEMD_PACKAGES = "\
SYSTEMD_SERVICE_${PN}-sensord = "sensord.service lm_sensors.service fancontrol.service" ${PN} \
${PN}-fancontrol \
${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)} \
"
SYSTEMD_SERVICE_${PN} = "lm_sensors.service"
SYSTEMD_SERVICE_${PN}-fancontrol = "fancontrol.service"
SYSTEMD_SERVICE_${PN}-sensord = "sensord.service"
SYSTEMD_AUTO_ENABLE = "disable" SYSTEMD_AUTO_ENABLE = "disable"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
@@ -46,13 +58,15 @@ do_compile() {
sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile
sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \ sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \
${S}/lib/Module.mk ${S}/lib/Module.mk
oe_runmake user PROG_EXTRA="sensors sensord" oe_runmake user PROG_EXTRA="sensors ${PACKAGECONFIG_CONFARGS}"
} }
do_install() { do_install() {
oe_runmake user_install DESTDIR=${D} oe_runmake user_install DESTDIR=${D}
install -m 0755 ${S}/prog/sensord/sensord ${D}${sbindir} if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
install -m 0644 ${S}/prog/sensord/sensord.8 ${D}${mandir}/man8 install -m 0755 ${S}/prog/sensord/sensord ${D}${sbindir}
install -m 0644 ${S}/prog/sensord/sensord.8 ${D}${mandir}/man8
fi
# Install directory # Install directory
install -d ${D}${INIT_D_DIR} install -d ${D}${INIT_D_DIR}
@@ -60,12 +74,17 @@ do_install() {
# Install fancontrol init script # Install fancontrol init script
install -m 0755 ${WORKDIR}/fancontrol.init ${D}${INIT_D_DIR}/fancontrol install -m 0755 ${WORKDIR}/fancontrol.init ${D}${INIT_D_DIR}/fancontrol
# Install sensord init script if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
install -m 0755 ${WORKDIR}/sensord.init ${D}${INIT_D_DIR}/sensord # Install sensord init script
install -m 0755 ${WORKDIR}/sensord.init ${D}${INIT_D_DIR}/sensord
fi
# Insall sensord service script # Insall sensord service script
install -d ${D}${systemd_system_unitdir} install -d ${D}${systemd_unitdir}/system
install -m 0644 ${S}/prog/init/*.service ${D}${systemd_system_unitdir} install -m 0644 ${S}/prog/init/*.service ${D}${systemd_unitdir}/system
if ! ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
rm ${D}${systemd_system_unitdir}/sensord.service
fi
} }
RPROVIDES_${PN}-dbg += "${PN}-libsensors-dbg ${PN}-sensors-dbg ${PN}-sensord-dbg ${PN}-isatools-dbg" RPROVIDES_${PN}-dbg += "${PN}-libsensors-dbg ${PN}-sensors-dbg ${PN}-sensord-dbg ${PN}-isatools-dbg"
@@ -89,7 +108,7 @@ PACKAGES =+ "${PN}-libsensors ${PN}-libsensors-dev ${PN}-libsensors-staticdev ${
PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc" PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc"
# sensord logging daemon # sensord logging daemon
PACKAGES =+ "${PN}-sensord ${PN}-sensord-doc" PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord ${PN}-sensord-doc', '', d)}"
# fancontrol script # fancontrol script
PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc" PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc"