UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer ewilliams01
Observer
2,430 Views
Registered: ‎09-21-2012

Location of Built Binaries

Jump to solution

Using the Petalinux 2016.2 toolchain, we developed a software update workflow around using the petalinux-build -c roofs/<app> command to build a binary which we were then able to pluck from the build directory and SCP over to our target board for execution. In 2017.3, running a "find . -name <app>" produces a bunch of results but none are the executable. We know it's being generated SOMEWHERE, because when we go through the entire process of updating the SD card with the rootfs.cpio image, running the application on the target always gives us the latest code, but we'd rather not have to do that every time we test changes.

 

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
2,991 Views
Registered: ‎10-04-2017

Re: Location of Built Binaries

Jump to solution

I usually just look in the rootfs, for example: build/tmp/work/plnx_arm-xilinx-linux-gnueabi/petalinux-user-image/1.0-r0/rootfs

 

However, I also build with #INHERIT += "rm_work" commented out in my local.conf because otherwise all the build artifacts and possibly the rootfs are removed all the time.  Something I find extremely annoying so I modified the petalinux template file to make sure it's always commented out.

 

jeff

 

View solution in original post

9 Replies
Mentor jmcclusk
Mentor
2,425 Views
Registered: ‎02-24-2014

Re: Location of Built Binaries

Jump to solution

If you can run the app from the command line,  why not try  "which <app>" and see what it finds?

Don't forget to close a thread when possible by accepting a post as a solution.
0 Kudos
Explorer
Explorer
2,412 Views
Registered: ‎03-22-2016

Re: Location of Built Binaries

Jump to solution

I believe what yocto is doing is building the package in a temporary directory, packaging it up in an RPM file, then removing all the temporary files. All the RPM files for your build are then installed into a root filesystem image.

 

There may be some way to convince bitbake to save a copy of the compiled executable for you instead of purging it, but it may be easier to instead extract it from the RPM.

 

Check this directory: build/tmp/deploy/rpm/aarch64/ (replace with your architecture)

 

EDIT: Better yet, use -x to pass flags to bitbake, such as:

 

petalinux-build -c your-component -x clean

petalinux-build -c your-component -x compile

petalinux-build -c your-component -x devshell

 

Specifically, "compile" will run the compile stage, but not package and purge the working directory. If you do that, you'll be able to find your executable in 'build/tmp/work/aarch64-xilinx-linux/your-component/1.0-r0/'.

 

"devshell" will open up a new terminal with the environment set up to cross-compile the application. "clean" will clean out the working directory.

Moderator
Moderator
2,385 Views
Registered: ‎04-24-2017

Re: Location of Built Binaries

Jump to solution

Hi @jeffsimpson,

 

DO NOT use yocto devshell/devtool in petalinux. It is not officially supported in petalinux you will run into build issues.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Explorer
Explorer
2,992 Views
Registered: ‎10-04-2017

Re: Location of Built Binaries

Jump to solution

I usually just look in the rootfs, for example: build/tmp/work/plnx_arm-xilinx-linux-gnueabi/petalinux-user-image/1.0-r0/rootfs

 

However, I also build with #INHERIT += "rm_work" commented out in my local.conf because otherwise all the build artifacts and possibly the rootfs are removed all the time.  Something I find extremely annoying so I modified the petalinux template file to make sure it's always commented out.

 

jeff

 

View solution in original post

2,360 Views
Registered: ‎04-20-2017

Re: Location of Built Binaries

Jump to solution
Ubuntu for example can also directly mount the. Cpio in the image directory. With that you can access the roots the same way as on the deployed board... And copy libs or you apps
Observer ewilliams01
Observer
2,293 Views
Registered: ‎09-21-2012

Re: Location of Built Binaries

Jump to solution
Commenting the INHERIT += "rm_work" line out in the local.conf file resulted in a new folder (./build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/<appname>/1.0-r0/) persisting in the build directory even after doing a petalinux-clean and then a petalinux-build -c <appname>.

Is it not normal requirement want to make small changes to userspace applications, cross-compile them separately, and then send to test on a target? I'm asking because I'm surprised there isn't a better/more obvious workflow for supporting this.
0 Kudos
2,277 Views
Registered: ‎04-20-2017

Re: Location of Built Binaries

Jump to solution
Not exactly clear on what you are asking about.

If you change your userspace app, cross compile with sdk and launch/debug it, sdk copies it to your target automatically under /mnt
Once you are satisfied or make new release rebuild and redeploy petalinux so your app is persistent in rootfs
Alternatively you can mount sd/flash in Linux with a initd script and always deploy just your app in those directories
0 Kudos
Explorer
Explorer
2,267 Views
Registered: ‎10-04-2017

Re: Location of Built Binaries

Jump to solution

I know I do it.  And when adding a new recipe I like to make sure everything got installed properly into the rootfs without re-flashing a device.  

 

Just FYI, the petalinux template for the 7000 local.conf is here in your petalinux install:

petalinx/2017.2/components/yocto/source/arm/conf/local.conf

 

I like modifying it in petalinx so it works for any device/BSP that I may be working with and doesn't require a change in just a local build.

 

jeff

0 Kudos
Moderator
Moderator
2,212 Views
Registered: ‎04-24-2017

Re: Location of Built Binaries

Jump to solution

If you want to use the build artifacts for debugging add the following line in <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf

 

RM_WORK_EXCLUDE += "recipe-name"
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos