简体   繁体   English

yocto 配方中定义的应用程序/二进制文件的位置在哪里?

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

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.我有一个以下配方,它运行一个所述服务,该服务反过来在启动时运行一个应用程序,但我试图了解应用程序的位置在哪里定义,最终在 sysfs 映像中。

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.目前, appSource二进制文件(在Makefile中定义)存储在/usr/bin中,但我不确定目标位置( /usr/bin )的定义位置。

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
}

Here is what I find out:这是我发现的:

You are inherit ing autotools-brokensep which has the following content:您正在inherit具有以下内容的autotools-brokensep

# 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:因此,它inherit了具有do_install内容的autotools

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 .因此,它将Makefileinstall目标运行到${D}中,即${WORKDIR}/image

So, I assume that your Makefile has an install target that copies the binary into /usr/bin .因此,我假设您的Makefile具有将二进制文件复制到/usr/bininstall目标。

For the FILES variable content, this is defined in bitbake.conf :对于FILES变量内容,这是在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.提供您的Makefile以确认我的假设,或者我对该主题进行进一步研究。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM