[yocto] lm-sensors not available as a package?

Jonathan Haws Jonathan.Haws at sdl.usu.edu
Wed Oct 17 13:21:35 PDT 2012


Marc,

If you have a working recipe, I would love to see it.  Maybe you have already solved some of the issues I have been seeing.

I have a recipe that installs the software, however, I would like to have it run sensors-detect on first boot as well as install the lm_sensors.init script to /etc/init.d.  My recipe now looks like this:

------------------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION = "Hardware health monitoring applications"
HOMEPAGE = "http://www.lm-sensors.org/"
DEPENDS = "sysfsutils virtual/libiconv"
LICENSE = "GPLv2"
PR = "r1"
DEPENDS = "bison-native flex-native"
PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2"

LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
                    file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
                   "

SRC_URI[md5sum] = "f357ba00b080ab102a170f7bf8bb2578"
SRC_URI[sha256sum] = "f13dd885406841a7352ccfb8b9ccb23c4c057abe3de4258da5444c149a9e3ae1"

S = "${WORKDIR}/lm_sensors-${PV}"

EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \
                MACHINE=${TARGET_ARCH} PREFIX=${prefix} CC="${CC}" AR="${AR}"'

do_compile() {
        oe_runmake user PROG_EXTRA=sensors
}

do_install() {
        oe_runmake user_install DESTDIR=${D}
        install -m 0755 ${S}/prog/init/lm_sensors.init ${D}/${sysconfdir}/init.d/lm_sensors.init

        ln -sf ../init.d/lm_sensors.init ${D}${sysconfdir}/rcS.d/S90lm_sensors.init
}

pkr_postinst_lmsensors-scripts() {
        #!/bin/sh -e
        if [ x"$D" = "x" ]; then
                # Actions to carry out on the device go here
                yes | sensors-detect
        else
                exit 1
        fi
}

PACKAGES =+ "lmsensors-sensors lmsensors-sensors-dbg"
PACKAGES =+ "lmsensors-scripts"

FILES_lmsensors-scripts = "${bindir}/*.pl ${bindir}/ddcmon ${sbindir}/fancontrol* ${sbindir}/pwmconfig ${sbindir}/sensors-detect ${sysconfdir}/init.d/lm_sensors.init"
RDEPENDS_lmsensors-scripts += "lmsensors-sensors perl bash perl-modules"

FILES_lmsensors-sensors = "${bindir}/sensors ${sysconfdir}"
FILES_lmsensors-sensors-dbg += "${bindir}/.debug/sensors"
------------------------------------------------------------------------------------------------------------------------------------------------

However, I get the following errors when building:

------------------------------------------------------------------------------------------------------------------------------------------------
ERROR: Function failed: do_install (see /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/temp/log.do_install.9255 for further information)
ERROR: Logfile of failure stored in: /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/temp/log.do_install.9255
Log data follows:
| DEBUG: Executing shell function do_install
| NOTE: make -j 4 LINUX=/opt/yocto/poky/build/tmp/sysroots/penryn/usr/src/kernel EXLDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed MACHINE=x86_64 PREFIX=/usr CC=x86_64-poky-linux-gcc    -m64  -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/opt/yocto/poky/build/tmp/sysroots/penryn AR=x86_64-poky-linux-ar user_install DESTDIR=/opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/lib /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/include/sensors /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man3 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man5
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/bin /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man1
| install -m 755 prog/detect/sensors-detect /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin
| install -m 755 prog/pwm/fancontrol prog/pwm/pwmconfig /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin
| install -m 755 prog/sensors/sensors /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/bin
| install -m 644 lib/libsensors.a /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/lib
| install -m 644 prog/pwm/fancontrol.8 prog/pwm/pwmconfig.8 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| install -m 644 prog/sensors/sensors.1 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man1
| install -m 644 prog/detect/sensors-detect.8 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/sensors.d
| if [ ! -e /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/sensors3.conf ] ; then \
|   install -m 644 etc/sensors.conf.default /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/sensors3.conf ; \
| fi
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| mkdir -p /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/bin
| install -m 755 etc/sensors-conf-convert /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/bin
| install -m 755 prog/dump/isadump prog/dump/isaset /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/sbin
| install -m 755 lib/libsensors.so.4.3.2 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/lib
| ln -sf libsensors.so.4.3.2 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/lib/libsensors.so.4
| if [ -e /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/modprobe.d/lm_sensors \
|      -a ! -e /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/modprobe.d/lm_sensors.conf ] ; then \
|   mv -f /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/modprobe.d/lm_sensors /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/etc/modprobe.d/lm_sensors.conf ; \
| fi
| ln -sf libsensors.so.4 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/lib/libsensors.so
| install -m 644 lib/error.h lib/sensors.h /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/include/sensors
| install -m 644 prog/dump/isadump.8 prog/dump/isaset.8 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man8
| install -m 644 lib/libsensors.3 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man3
| install -m 644 lib/sensors.conf.5 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man5
| ln -sf sensors.conf.5 /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image/usr/man/man5/sensors3.conf.5
| *** Important notes:
| ***  * The libsensors configuration file (/etc/sensors3.conf) is never
| ***    overwritten by our installation process, so that you won't lose
| ***    your personal settings in that file. You still can get our latest
| ***    default config file in etc/sensors.conf.default and manually copy
| ***    it to /etc/sensors3.conf if you want. You will then want to
| ***    edit it to fit your needs again.
| ***  * The format of /etc/sensors3.conf changed with lm-sensors 3.0.0.
| ***    If you have a custom configuration file using the old format, you
| ***    can convert it using the sensors-conf-convert script. Otherwise just
| ***    overwrite your old configuration file with the new default one.
| ***  * As of lm-sensors 3.1.0, the default configuration file only
| ***    contains statements which do not depend on how chips are wired.
| ***    If you miss parts of the bigger configuration file that used to be
| ***    the default, copy the relevant parts from etc/sensors.conf.eg to
| ***    /etc/sensors3.conf.
| install: cannot create regular file `/opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/image//etc/init.d/lm_sensors.init': No such file or directory
| ERROR: Function failed: do_install (see /opt/yocto/poky/build/tmp/work/penryn-poky-linux/lmsensors-apps-3.3.2-r1/temp/log.do_install.9255 for further information)
ERROR: Task 387 (/opt/yocto/poky/meta-intel/meta-penryn/recipes-extended/lm_sensors/lmsensors-apps_3.3.2.bb, do_install) failed with exit code '1'
------------------------------------------------------------------------------------------------------------------------------------------------

Can anyone tell me how I can get the lm_sensors.init script installed into /etc/init.d?  I don't understand why when I follow the same syntax as the initscripts recipe, this fails.

As a sidenote, I would also like to get a /data directory installed as part of the rootfs via a recipe (as a mountpoint for a secondary disk).  How is that typically done?

Thanks!
Jonathan

________________________________________
From: Marc Ferland [marc.ferland at gmail.com] on behalf of Marc Ferland [ferlandm at sonatest.com]
Sent: Tuesday, October 16, 2012 12:27
To: Jonathan Haws
Cc: yocto at yoctoproject.org
Subject: Re: [yocto] lm-sensors not available as a package?

Jonathan Haws <Jonathan.Haws at sdl.usu.edu> writes:

> I got the oe-classic recipe building with the latest version of
> lm-sensors.  However, I am now running into perl issues - when I try
> to run sensors-detect, I get errors with the @INC paths - strict.pm is
> not found anywhere on the filesystem.  I went back to see if I had
> left out perl support, but it was present and included.  Where is
> strict.pm?  How can I get that in my image?
>
> Thanks!
>
You might want to add 'perl-modules' to RDEPENDS_lmsensors-scripts.

Marc



More information about the yocto mailing list