cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mentor
Mentor
6,030 Views
Registered: ‎11-29-2007

PetaLinux 2016.4: Package app into image

On PetaLinux 2016.4, after recompiling my user application, how do I install it into the downloadable image?

 

My workflow is currently:

# change some code in myapp.c
petalinux-build
petalinux-boot --jtag --fpga --kernel

 

However, petalinux-build takes a long time, so I would like to do something like the following:

# change some code in myapp.c
petalinux-build -c myapp
petalinux-build -x package
petalinux-boot --jtag --fpga --kernel

as described in UG1144 page 55 "Steps to Build User Application". However, this does not work: After Linux boots on the Zynq, the filesystem still contains the previous version of myapp. What's the correct sequence of steps? Thanks in advance fo any help.



Please google your question before asking it.
If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).
0 Kudos
Reply
7 Replies
Contributor
Contributor
6,011 Views
Registered: ‎08-31-2016

I think you need to install the compiled application to the target root filesystem before you run the "package" step.  Try this step (from the same page in UG1144):

 

To install the selected user application:
$ petalinux-build -c rootfs/myapp -x do_install
This will install the application into the target rootfs host copy:
<plnx-proj-root>/build/tmp/work/{MACHINE}-linux-gnueabi/petalinu
x-user-image/1.0-r0/rootfs/

 

 

0 Kudos
Reply
Moderator
Moderator
5,991 Views
Registered: ‎09-12-2007

You can try petalinux-build -c roots/myapp -x compile
0 Kudos
Reply
Moderator
Moderator
5,957 Views
Registered: ‎12-04-2016

Hi

 

To build myapp into an existing system image:
$ cd <plnx-proj-root>
$ petalinux-build -c rootfs -x do_gen_sysroot
$ petalinux-build -c myapp
$ petalinux-build -x package
Note: do_gen_sysroot is to generate the sysroot based on the selected prebuilt packages
options from the menuconfig. You do not have to always run do_gen_sysroot before building the
application, but you need to run it at least once before you build the application.

0 Kudos
Reply
Mentor
Mentor
5,857 Views
Registered: ‎11-29-2007


@Anonymous wrote:

I think you need to install the compiled application to the target root filesystem before you run the "package" step.  Try this step (from the same page in UG1144):

 

To install the selected user application:
$ petalinux-build -c rootfs/myapp -x do_install
This will install the application into the target rootfs host copy:
<plnx-proj-root>/build/tmp/work/{MACHINE}-linux-gnueabi/petalinu
x-user-image/1.0-r0/rootfs/

 

 


You mean, like this?

petalinux-build -c myapp
petalinux-build -c myapp -x do_install
petalinux-build -x package
petalinux-boot --jtag --fpga --kernel

This doesn't work: after booting, the version of "myapp" is still the old one.

 


@stephenm wrote:
You can try petalinux-build -c roots/myapp -x compile

This also didn't help, it still boots with the old version.

 

 


@shabbirk wrote:

Hi

 

To build myapp into an existing system image:
$ cd <plnx-proj-root>
$ petalinux-build -c rootfs -x do_gen_sysroot
$ petalinux-build -c myapp
$ petalinux-build -x package
Note: do_gen_sysroot is to generate the sysroot based on the selected prebuilt packages
options from the menuconfig. You do not have to always run do_gen_sysroot before building the
application, but you need to run it at least once before you build the application.


I did that, but -x do_gen_sysroot doesn't exist in 2016.4:

$ petalinux-build -c rootfs -x do_gen_sysroot
...
ERROR: Task do_gen_sysroot does not exist for target petalinux-user-image. Close matches:
  do_populate_sysroot
...

I replaced it with petalinux-build -c rootfs -x do_populate_sysroot, but it didn't help. I don't think this is where the problem lies, since the file system exists, it just doesn't get updated with new versions of my executable the way it should be.

 

 

This is frustrating! UG1144 is out of date (e.g., it still often uses "-c rootfs/myapp" instead of "-c myapp"), and the commands don't behave as described. Is there any documentation what each "-x" command actually does?



Please google your question before asking it.
If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).
0 Kudos
Reply
Adventurer
Adventurer
3,361 Views
Registered: ‎11-10-2017

Hello,

 

i also ran into a similar problem:

https://forums.xilinx.com/t5/Embedded-Linux/How-to-include-a-user-app-in-petalinux-SD-Card-package/td-p/824969

 

How were you able to include the app in the package ? Any success with the soultion or any alternate way ?

0 Kudos
Reply
Contributor
Contributor
3,108 Views
Registered: ‎06-06-2017

Hi @awillen

I was wondering if you have managed to solve this issue, because I run into the same problem.

 

I am trying to build only my app and not the whole petalinux project  by following the UG1144 i.e.

$ petalinux-build -c myapp
$ petalinux-build -x package

$petalinux-package --boot --force --fsbl myfsbl.elf --fpga mybit.bit --u-boot

 

but it seems when i execute the app from /usr/bin is not the updated one. 

The only command that worked for me is

$ petalinux-build

 

Thanx in advance

0 Kudos
Reply
Mentor
Mentor
3,098 Views
Registered: ‎11-29-2007


@amatsaka wrote:

Hi @awillen

I was wondering if you have managed to solve this issue, because I run into the same problem.


No, I gave up and just did petalinux-build every time I wanted to create a new image. For quick tests, I used

petalinux-build -c APP_NAME -x do_compile

and copied the executable from

build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/APP_NAME/1.0-r0/PATH/APP_NAME

to the running system using scp.



Please google your question before asking it.
If someone answers your question, mark the post with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (the star on the left).
0 Kudos
Reply