Home > Software engineering >  Bitbake binary file not found
Bitbake binary file not found

Time:03-30

I am using bitbake to build and deploy my application to my linux build. I was recently made aware that my binary application was not being deployed to /usr/bin. I was told to update my mainapplication.bb to have the following line. install -m 0644 ${S}/MAIN_Application ${D}${bindir}

Doing do causes my bitbake build to crash as it cannot find the MAIN_Application binary file.

My full bitbake file is as follows

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "\
    file://MAIN_Application \
        file://services \   
    "

inherit autotools systemd

S = "${WORKDIR}/MAIN_Application"

DEPENDS  = "libsocketcan"

SYSTEMD_SERVICE_${PN} = "MAINapplication.service"

do_install_append () {
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/services/MAINapplication.service ${D}${systemd_system_unitdir}
    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/MAINapplication.service
    install -m 0644 ${S}/MAIN_Application ${D}${bindir}
}

I am using autotools, I have a makefile.am, configure.ac and autogen script. Running them locally I get the appropriate binary file which I can place onto the device and run. I am wondering why bitbake cannot find the binary file in its automated process.

Edit: The binary file is created and stored at build-fb/tmp/work/cortexa7t2hf-neon-poky-linux-gnueabi/mainapplication/0.0-r0/build. Is my path incorrect?

CodePudding user response:

autotools compiles into build folder which is ${B}

Just confirm that that is your build directory:

bitbake -e mainapplication | grep ^B=

and change this line:

install -m 0644 ${S}/MAIN_Application ${D}${bindir}

by this line:

install -m 0644 ${B}/MAIN_Application ${D}${bindir}
  • Related