diff options
author | Callaghan, Dan <dan.callaghan@opengear.com> | 2019-09-16 10:28:11 +1000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-09-16 18:24:48 -0700 |
commit | df10367ebd0a2432acb9ba4114c68dc0459d8fd8 (patch) | |
tree | 363e34f379ff9505b8afae92cb12ea317de245cf | |
parent | 9b2a48016aa9f204e739c205902d28e486f83585 (diff) | |
download | meta-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.bb | 23 | ||||
-rw-r--r-- | meta-oe/recipes-bsp/lm_sensors/lmsensors_3.5.0.bb | 41 |
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 | " |
15 | S = "${WORKDIR}" | 15 | S = "${WORKDIR}" |
16 | 16 | ||
17 | PACKAGECONFIG ??= "sensord" | ||
18 | PACKAGECONFIG[sensord] = ",," | ||
19 | |||
17 | RDEPENDS_${PN}-dev = "" | 20 | RDEPENDS_${PN}-dev = "" |
18 | 21 | ||
19 | do_install() { | 22 | do_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 |
39 | PACKAGES =+ "${PN}-libsensors" | 44 | PACKAGES =+ "${PN}-libsensors" |
40 | 45 | ||
41 | # sensord logging daemon configuration | 46 | # sensord logging daemon configuration |
42 | PACKAGES =+ "${PN}-sensord" | 47 | PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)}" |
43 | 48 | ||
44 | # fancontrol script configuration | 49 | # fancontrol script configuration |
45 | PACKAGES =+ "${PN}-fancontrol" | 50 | PACKAGES =+ "${PN}-fancontrol" |
46 | 51 | ||
47 | # sensord web cgi support | 52 | # sensord web cgi support |
48 | PACKAGES =+ "${PN}-cgi" | 53 | PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-cgi', '', d)}" |
49 | RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi" | 54 | RRECOMMENDS_${PN}-cgi = "lighttpd lighttpd-module-cgi" |
50 | RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool" | 55 | RDEPENDS_${PN}-cgi = "${PN}-sensord rrdtool" |
51 | FILES_${PN}-cgi = "/www/*" | 56 | FILES_${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 | ||
24 | RDEPENDS_${PN}-dev = "" | 24 | RDEPENDS_${PN}-dev = "" |
25 | 25 | ||
26 | INITSCRIPT_PACKAGES = "${PN}-fancontrol ${PN}-sensord" | 26 | PACKAGECONFIG ??= "sensord" |
27 | PACKAGECONFIG[sensord] = "sensord,,rrdtool" | ||
28 | |||
29 | INITSCRIPT_PACKAGES = "\ | ||
30 | ${PN}-fancontrol \ | ||
31 | ${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord', '', d)} \ | ||
32 | " | ||
27 | INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol" | 33 | INITSCRIPT_NAME_${PN}-fancontrol = "fancontrol" |
28 | INITSCRIPT_NAME_${PN}-sensord = "sensord" | 34 | INITSCRIPT_NAME_${PN}-sensord = "sensord" |
29 | INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" | 35 | INITSCRIPT_PARAMS_${PN}-fancontrol = "defaults 66" |
30 | INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" | 36 | INITSCRIPT_PARAMS_${PN}-sensord = "defaults 67" |
31 | 37 | ||
32 | SYSTEMD_PACKAGES = "${PN}-sensord" | 38 | SYSTEMD_PACKAGES = "\ |
33 | SYSTEMD_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 | " | ||
43 | SYSTEMD_SERVICE_${PN} = "lm_sensors.service" | ||
44 | SYSTEMD_SERVICE_${PN}-fancontrol = "fancontrol.service" | ||
45 | SYSTEMD_SERVICE_${PN}-sensord = "sensord.service" | ||
34 | SYSTEMD_AUTO_ENABLE = "disable" | 46 | SYSTEMD_AUTO_ENABLE = "disable" |
35 | 47 | ||
36 | S = "${WORKDIR}/git" | 48 | S = "${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 | ||
52 | do_install() { | 64 | do_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 | ||
71 | RPROVIDES_${PN}-dbg += "${PN}-libsensors-dbg ${PN}-sensors-dbg ${PN}-sensord-dbg ${PN}-isatools-dbg" | 90 | 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 ${ | |||
89 | PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc" | 108 | PACKAGES =+ "${PN}-sensors ${PN}-sensors-doc" |
90 | 109 | ||
91 | # sensord logging daemon | 110 | # sensord logging daemon |
92 | PACKAGES =+ "${PN}-sensord ${PN}-sensord-doc" | 111 | PACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'sensord', '${PN}-sensord ${PN}-sensord-doc', '', d)}" |
93 | 112 | ||
94 | # fancontrol script | 113 | # fancontrol script |
95 | PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc" | 114 | PACKAGES =+ "${PN}-fancontrol ${PN}-fancontrol-doc" |