summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCallaghan, Dan <dan.callaghan@opengear.com>2019-09-16 10:28:11 +1000
committerKhem Raj <raj.khem@gmail.com>2019-09-16 18:24:48 -0700
commitdf10367ebd0a2432acb9ba4114c68dc0459d8fd8 (patch)
tree363e34f379ff9505b8afae92cb12ea317de245cf
parent9b2a48016aa9f204e739c205902d28e486f83585 (diff)
downloadmeta-openembedded-df10367ebd0a2432acb9ba4114c68dc0459d8fd8.tar.gz
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>
-rw-r--r--meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb23
-rw-r--r--meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb41
2 files changed, 44 insertions, 20 deletions
diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb b/meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb
index b0091d657..b55bd5161 100644
--- a/meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb
+++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors-config_1.0.bb
@@ -14,6 +14,9 @@ SRC_URI = "file://fancontrol \
14" 14"
15S = "${WORKDIR}" 15S = "${WORKDIR}"
16 16
17PACKAGECONFIG ??= "sensord"
18PACKAGECONFIG[sensord] = ",,"
19
17RDEPENDS_${PN}-dev = "" 20RDEPENDS_${PN}-dev = ""
18 21
19do_install() { 22do_install() {
@@ -25,27 +28,29 @@ do_install() {
25 install -d ${D}${sysconfdir}/sensors.d 28 install -d ${D}${sysconfdir}/sensors.d
26 install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d 29 install -m 0644 ${WORKDIR}/sensors.conf ${D}${sysconfdir}/sensors.d
27 30
28 # Install sensord configuration file 31 if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
29 install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir} 32 # Install sensord configuration file
33 install -m 0644 ${WORKDIR}/sensord.conf ${D}${sysconfdir}
30 34
31 # Install sensord.cgi script and create world-writable 35 # Install sensord.cgi script and create world-writable
32 # web-accessible sensord directory 36 # web-accessible sensord directory
33 install -d ${D}/www/pages/cgi-bin 37 install -d ${D}/www/pages/cgi-bin
34 install -m 0755 ${WORKDIR}/sensord.cgi ${D}/www/pages/cgi-bin 38 install -m 0755 ${WORKDIR}/sensord.cgi ${D}/www/pages/cgi-bin
35 install -d -m a=rwxs ${D}/www/pages/sensord 39 install -d -m a=rwxs ${D}/www/pages/sensord
40 fi
36} 41}
37 42
38# libsensors configuration 43# libsensors configuration
39PACKAGES =+ "${PN}-libsensors" 44PACKAGES =+ "${PN}-libsensors"
40 45
41# sensord logging daemon configuration 46# sensord logging daemon configuration
42PACKAGES =+ "${PN}-sensord" 47PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)}"
43 48
44# fancontrol script configuration 49# fancontrol script configuration
45PACKAGES =+ "${PN}-fancontrol" 50PACKAGES =+ "${PN}-fancontrol"
46 51
47# sensord web cgi support 52# sensord web cgi support
48PACKAGES =+ "${PN}-cgi" 53PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-cgi', '', d)}"
49RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi" 54RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi"
50RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool" 55RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool"
51FILES_${PN}-cgi = "/www/*" 56FILES_${PN}-cgi = "/www/*"
diff --git a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb
index 585dc9481..ffafd17f8 100644
--- a/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb
+++ b/meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb
@@ -23,14 +23,26 @@ inherit update-rc.d systemd
23 23
24RDEPENDS_${PN}-dev = "" 24RDEPENDS_${PN}-dev = ""
25 25
26INITSCRIPT_PACKAGES = "${PN}-fancontrol ${PN}-sensord" 26PACKAGECONFIG ??= "sensord"
27PACKAGECONFIG[sensord] = "sensord,,rrdtool"
28
29INITSCRIPT_PACKAGES = "\
30 ${PN}-fancontrol \
31 ${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)} \
32 "
27INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol" 33INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol"
28INITSCRIPT_NAME_${PN}-sensord = "sensord" 34INITSCRIPT_NAME_${PN}-sensord = "sensord"
29INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" 35INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66"
30INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" 36INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67"
31 37
32SYSTEMD_PACKAGES = "${PN}-sensord" 38SYSTEMD_PACKAGES = "\
33SYSTEMD_SERVICE_${PN}-sensord = "sensord.service lm_sensors.service fancontrol.service" 39 ${PN} \
40 ${PN}-fancontrol \
41 ${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)} \
42 "
43SYSTEMD_SERVICE_${PN} = "lm_sensors.service"
44SYSTEMD_SERVICE_${PN}-fancontrol = "fancontrol.service"
45SYSTEMD_SERVICE_${PN}-sensord = "sensord.service"
34SYSTEMD_AUTO_ENABLE = "disable" 46SYSTEMD_AUTO_ENABLE = "disable"
35 47
36S = "${WORKDIR}/git" 48S = "${WORKDIR}/git"
@@ -46,13 +58,15 @@ do_compile() {
46 sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile 58 sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' ${S}/Makefile
47 sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \ 59 sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \
48 ${S}/lib/Module.mk 60 ${S}/lib/Module.mk
49 oe_runmake user PROG_EXTRA="sensors sensord" 61 oe_runmake user PROG_EXTRA="sensors ${PACKAGECONFIG_CONFARGS}"
50} 62}
51 63
52do_install() { 64do_install() {
53 oe_runmake user_install DESTDIR=${D} 65 oe_runmake user_install DESTDIR=${D}
54 install -m 0755 ${S}/prog/sensord/sensord ${D}${sbindir} 66 if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
55 install -m 0644 ${S}/prog/sensord/sensord.8 ${D}${mandir}/man8 67 install -m 0755 ${S}/prog/sensord/sensord ${D}${sbindir}
68 install -m 0644 ${S}/prog/sensord/sensord.8 ${D}${mandir}/man8
69 fi
56 70
57 # Install directory 71 # Install directory
58 install -d ${D}${INIT_D_DIR} 72 install -d ${D}${INIT_D_DIR}
@@ -60,12 +74,17 @@ do_install() {
60 # Install fancontrol init script 74 # Install fancontrol init script
61 install -m 0755 ${WORKDIR}/fancontrol.init ${D}${INIT_D_DIR}/fancontrol 75 install -m 0755 ${WORKDIR}/fancontrol.init ${D}${INIT_D_DIR}/fancontrol
62 76
63 # Install sensord init script 77 if ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
64 install -m 0755 ${WORKDIR}/sensord.init ${D}${INIT_D_DIR}/sensord 78 # Install sensord init script
79 install -m 0755 ${WORKDIR}/sensord.init ${D}${INIT_D_DIR}/sensord
80 fi
65 81
66 # Insall sensord service script 82 # Insall sensord service script
67 install -d ${D}${systemd_system_unitdir} 83 install -d ${D}${systemd_unitdir}/system
68 install -m 0644 ${S}/prog/init/*.service ${D}${systemd_system_unitdir} 84 install -m 0644 ${S}/prog/init/*.service ${D}${systemd_unitdir}/system
85 if ! ${@bb.utils.contains('PACKAGECONFIG', 'sensord', 'true', 'false', d)}; then
86 rm ${D}${systemd_system_unitdir}/sensord.service
87 fi
69} 88}
70 89
71RPROVIDES_${PN}-dbg += "${PN}-libsensors-dbg ${PN}-sensors-dbg ${PN}-sensord-dbg ${PN}-isatools-dbg" 90RPROVIDES_${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 ${
89PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc" 108PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc"
90 109
91# sensord logging daemon 110# sensord logging daemon
92PACKAGES =+ "${PN}-sensord ${PN}-sensord-doc" 111PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord ${PN}-sensord-doc', '', d)}"
93 112
94# fancontrol script 113# fancontrol script
95PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc" 114PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc"