0

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?

1 Answer 1

1

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}
Sign up to request clarification or add additional context in comments.

5 Comments

Last comment, this did work but when spawning the process it failed with a Permission Denied error. Is there a command to run before this to give permissions?
You got Permission Denied on the board? If yes, try to change the permissions on the board with chmod, then take the correct permissions and change them in place of 0644 in the recipe.
Yes running ssytemctl status mainapplication. I attempted to EXEC but ran into a permission denied error
Are you adding a custom user (other than root) ?
I did get it working. Ideally yes a custom user will be added

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.