Where's the location of the app/binary defined in a yocto recipe?

Viewed 64

I have a following recipe which runs a said service which in turns runs an app on boot-up, but I am trying to understand where the location of the app defined which ends up in sysfs image.

Currently, the appSource binary (defined in Makefile) gets stored in /usr/bin but I'm not sure where the destination location (/usr/bin) is defined.

The following command results in

$ bitbake -e appSource | grep ^FILES_${PN}

FILES_appSource="/usr/bin/* /usr/sbin/* /usr/libexec/* /usr/lib/lib*.so.*             /etc /com /var             /bin/* /sbin/*             /lib/*.so.*             /lib/udev /usr/lib/udev             /lib/udev /usr/lib/udev

Here's the recipe

inherit autotools-brokensep pkgconfig

DESCRIPTION = "A sample recipe"
LICENSE = "CLOSED"

DEPENDS = "glib-2.0"

FILESPATH =+ "${THISDIR}:"
SRC_URI = "file://appSource"
S = "${WORKDIR}/appSource""

FILES_${PN} += "${systemd_unitdir}/*"

INIT_MANAGER = "systemd"

do_install_append() {   
   if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
      install -d ${D}/etc/initscripts
      install -d ${D}${systemd_unitdir}/system
      install -m 0644 ${WORKDIR}/appService/appService.service ${D}${systemd_unitdir}/system/appService.service
      install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/
      ln -sf ${systemd_unitdir}/system/appService.service  ${D}${systemd_unitdir}/system/multi-user.target.wants/appService.service
  fi
}

1 Answers

Here is what I find out:

You are inheriting autotools-brokensep which has the following content:

# Autotools class for recipes where separate build dir doesn't work
# Ideally we should fix software so it does work. Standard autotools supports
# this.
inherit autotools
B = "${S}"

So, it inherit autotools which has do_install with the content of:

autotools_do_install() {
    oe_runmake 'DESTDIR=${D}' install
    # Info dir listing isn't interesting at this point so remove it if it exists.
    if [ -e "${D}${infodir}/dir" ]; then
        rm -f ${D}${infodir}/dir
    fi
}

So, it runs the install target of your Makefile into ${D} which is ${WORKDIR}/image.

So, I assume that your Makefile has an install target that copies the binary into /usr/bin.

For the FILES variable content, this is defined in bitbake.conf:

FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \ ...

Provide your Makefile to confirm my assumption, or I do a further research on the topic.

Related