cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
MartinH1
Visitor
Visitor
1,446 Views
Registered: ‎07-16-2020

How to build image-full with petalinux tools (petalinux-build)

Jump to solution

Hallo community,

sorry for this noob question, but I am starting out new with petalinux tools and have before only worked with yocto/bitbake directly.

Following the developments tools reference guide for release 2020.1 I am able to build and boot a "petalinux-image-minimal" for zcu104 using petalinux-buiild and all the other tools. Now I want to build "petalinux-image-full" (and later create my customt image targets) - however I don't find any documentation how to change the target image.

What is the recommended way to change between target images when using the petalinux tools environment?

Please note that I am able to build using the Xilinx https://github.com/Xilinx/yocto-manifests and run bitbake petlainux-image-full. But the default config files generated here are missing all the XSCT magic the petalinux tools provide. So I would prefer to use the official way.

Thanks and cheers, Martin

0 Kudos
1 Solution

Accepted Solutions
ksloatdesignlinx
Explorer
Explorer
1,363 Views
Registered: ‎02-24-2020

So you can invoke specific Bitbake recipes by using the -c flag in the command, so i.e. in your  case you could do:

 

petalinux-build -c petalinux-image-full

By default, petalinux-build without modifiers actually operates not on petalinux-image-minimal but on petalinux-user-image.bb. You will find this in the generated folders in your PetaLinux project (./project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb). This base recipe includes some base petalinux related files and ultimately inherits core-image.

 

So really if you want to integrate things properly the PetaLinux way, you could for example just make a petalinux-user-image.bbappend file in "./project-spec/meta-user/recipes-core/images/"  and add

require ./recipes-core/images/petalinux-image-full.bb

along with whatever other modifications you want to make to your image.

I was just like you where I started from a Yocto background before learning PetaLinux. Remember though, PetaLinux is Yocto/Bitbake under the hood. So pretty much anything possible in Yocto is possible in PetaLinux. Xilinx has simply added some additional classes and scripts on top of it to help automate the process of wrapping their tools and such into a Yocto based image.

Below is some more information about Yocto and PetaLinux from Xilinx:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841883/Yocto

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com

View solution in original post

6 Replies
ksloatdesignlinx
Explorer
Explorer
1,364 Views
Registered: ‎02-24-2020

So you can invoke specific Bitbake recipes by using the -c flag in the command, so i.e. in your  case you could do:

 

petalinux-build -c petalinux-image-full

By default, petalinux-build without modifiers actually operates not on petalinux-image-minimal but on petalinux-user-image.bb. You will find this in the generated folders in your PetaLinux project (./project-spec/meta-plnx-generated/recipes-core/images/petalinux-user-image.bb). This base recipe includes some base petalinux related files and ultimately inherits core-image.

 

So really if you want to integrate things properly the PetaLinux way, you could for example just make a petalinux-user-image.bbappend file in "./project-spec/meta-user/recipes-core/images/"  and add

require ./recipes-core/images/petalinux-image-full.bb

along with whatever other modifications you want to make to your image.

I was just like you where I started from a Yocto background before learning PetaLinux. Remember though, PetaLinux is Yocto/Bitbake under the hood. So pretty much anything possible in Yocto is possible in PetaLinux. Xilinx has simply added some additional classes and scripts on top of it to help automate the process of wrapping their tools and such into a Yocto based image.

Below is some more information about Yocto and PetaLinux from Xilinx:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841883/Yocto

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com

View solution in original post

MartinH1
Visitor
Visitor
1,335 Views
Registered: ‎07-16-2020

Thank you @ksloatdesignlinx , that helps alot understanding petalinux-tools and helps getting started!

However, I cannot find a recipe named petalinux-user-image.bb or a folder meta-plnx-generated. In fact I cannot find any other image recipe besides the ones from core/, meta-xilinx/, meta-petalinux/ and meta-vitis-ai/ - all located under components/yocto/layers/.

I am using petalinux-tools release v2020.1 , could there have been some recent changes?

Thanks and greetings, Martin

0 Kudos
ksloatdesignlinx
Explorer
Explorer
1,321 Views
Registered: ‎02-24-2020

Hi @MartinH1 

So just to double check, to follow my flow, you will need to do so within a PetaLinux project you have created. When you create a new project, PetaLinux generates several Yocto related files and then creates a user layer (meta-user) within your project where you can add your own recipes or appends.

I double checked with 2020.1 when creating a new project. You will need to make sure you create a project with a BSP or configure with an xsa file. If you create an empty project it will not generate the petalinux-user-image.bb file. After doing this you should see the file.

i.e.

petalinux-create -t project -n my-petalinux-project --template zynqMP -s /path/to/your/bsp/file.bsp

After doing this your top level directory structure should look like follows:

components  config.project  hardware  pre-built  project-spec  README  README.hw

 

Ken Sloat - Embedded Software Engineer
https://www.designlinxhs.com
MartinH1
Visitor
Visitor
1,313 Views
Registered: ‎07-16-2020

Thanks @ksloatdesignlinx !

My "mistake" was to omit the -s parameter in petalinux-create, as I was following chapter "Creating an Empty Project from a Template" from the 2020.1 petalinux-tools-reference-guide.pdf. After creating a new project the mentioned folder and recipe are available. EDIT: see next post

MartinH1
Visitor
Visitor
1,238 Views
Registered: ‎07-16-2020

Sorry to re-open old threads, but I think I made a mistake when previously answering (I just quickly looked into the filesystem, must have overlocked something):

I cannot find /project-spec/meta-plnx-generated/ and petalinux-user-image.bb 

Could it be that this recipe is obsolete with 2020.1 release? Comparing releases 2020.1 and 2019.1 in UG1144 - PetaLinux Tools Documentation Reference Guide - Chapter 4 Build System Image there is a mayor difference in the recipe used:

2020.1 see https://www.xilinx.com/support/documentation/sw_manuals/xilinx2020_1/ug1144-petalinux-tools-reference-guide.pdf

petalinux-build
INFO: sourcing build tools
[INFO] building project [...]
[INFO] generating workspace directory INFO: bitbake petalinux-image-minimal

2019.1 see https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1144-petalinux-tools-reference-guide.pdf

[INFO] building project
[...]
[INFO] generating petalinux-user-image.bb
INFO: bitbake petalinux-user-image

It seems like 2020.1 always bases itself on petalinux-image-minimal...

0 Kudos
cbureriu
Visitor
Visitor
811 Views
Registered: ‎08-04-2019

adding user apps in PetaLinux 2020.2

  1. edit config file
    ../project-spec/meta-user/conf/user-rootfsconfig
    append following line to add 'mc' or any other package(s) to rootfs
    CONFIG_mc
  2. run
    petalinux-config -c rootfs
  3. activate app in user packages
    [x] mc
  4. ready
    rebuild, repackage, write onto sd-card, boot

 

0 Kudos