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: 
Participant nahol
Participant
556 Views
Registered: ‎05-31-2016

Add python-pyelftools python package to Petalinux

Jump to solution

I require the python-pyelftools for building a petalinux project running on a ZCU102 board.

Unfortunately, this package is not present inside /PetalinuxInstallDir/components/yocto/source/aarch64/layers/meta-openembedded/meta-python/recipes-devtools and thus cannot be added to petalinuxbsp.conf via

IMAGE_INSTALL_append = " \
python-pyelftools \
"

I've tried to manually copy a .bb recipe obtained from https://layers.openembedded.org/layerindex/recipe/60427/ in meta-python/recipes-devtools and then add this package inside petalinuxbsp.conf, but this didn't solve the issue.

Any help for solving the issue would be appreciated :)

Best regards,
Mathieu

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer shustik
Observer
535 Views
Registered: ‎07-14-2017

Re: Add python-pyelftools python package to Petalinux

Jump to solution

O. I did:
go to petlnx_setup_dir/components/yocto/source/arm(I have arm 32 bit processor)/layers/
git clone -b rocko (my linx yocto version) --single-branch https://github.com/plihp/meta-measured.git (your package is in this layer)
then go to your project dir and enter
petalinux-config -> Yocto Settings -> User Layers --->
Enter petlnx_setup_dir/components/yocto/source/arm(I have arm 32 bit processor)/layers/meta-measured
Save and exit

To check adding of layer: your_proj_dir/build/conf/bblayers.conf. You should see here BBLAYERS:="\

...

.../meta-measured \

"
go to your project dir/project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend
and type to the end of petalinux-image-full file:
IMAGE_INSTALL_append = " pyelftools"
save

petalinux-config -c rootfs

user packages -> [*] pyelftools

save & exit
petalinux-build
it tells that can't find setuptools, but it understands where to find pyelftools
And now may be repeat with setuptools?

6 Replies
Observer shustik
Observer
548 Views
Registered: ‎07-14-2017

Re: Add python-pyelftools python package to Petalinux

Jump to solution

I have the similar problem with rocko python-cycler... So right now I installed pip in my petalinux and use pip install cycler... Not very good idea but It works

0 Kudos
Highlighted
Observer shustik
Observer
536 Views
Registered: ‎07-14-2017

Re: Add python-pyelftools python package to Petalinux

Jump to solution

O. I did:
go to petlnx_setup_dir/components/yocto/source/arm(I have arm 32 bit processor)/layers/
git clone -b rocko (my linx yocto version) --single-branch https://github.com/plihp/meta-measured.git (your package is in this layer)
then go to your project dir and enter
petalinux-config -> Yocto Settings -> User Layers --->
Enter petlnx_setup_dir/components/yocto/source/arm(I have arm 32 bit processor)/layers/meta-measured
Save and exit

To check adding of layer: your_proj_dir/build/conf/bblayers.conf. You should see here BBLAYERS:="\

...

.../meta-measured \

"
go to your project dir/project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend
and type to the end of petalinux-image-full file:
IMAGE_INSTALL_append = " pyelftools"
save

petalinux-config -c rootfs

user packages -> [*] pyelftools

save & exit
petalinux-build
it tells that can't find setuptools, but it understands where to find pyelftools
And now may be repeat with setuptools?

Participant nahol
Participant
487 Views
Registered: ‎05-31-2016

Re: Add python-pyelftools python package to Petalinux

Jump to solution

Thank you very much for this detail answer.

I'm using Petalinux 2019.1 which relies on Yocto 2.6 (thud) and there is no meta-measured  layer for this version. I have managed to reproduce your steps by cloning a branch based on rocko, but the package remains not found during petalinux-build.

Does anyone has another suggestion to solve the issue ?

0 Kudos
Observer shustik
Observer
484 Views
Registered: ‎07-14-2017

Re: Add python-pyelftools python package to Petalinux

Jump to solution

Do you have internet connection on your board? Try use offline pip install pyelftools?

0 Kudos
Participant nahol
Participant
455 Views
Registered: ‎05-31-2016

Re: Add python-pyelftools python package to Petalinux

Jump to solution

In my special use case (installation of OP-TEE 3.5.0 via https://github.com/OP-TEE/build), the pip solution is in my opinion not applicable.

I'm using OP-TEE 3.4.0 instead of 3.5.0, the 3.4 does not require pyelftools and hence build on Petalinux 2019.1 after a few adapation of the zynqmp build found on the OP-TEE/build github.

Thanks for the help, your solution can be a good guideline for people with a similar issue :)

 

0 Kudos
Visitor asooy
Visitor
350 Views
Registered: ‎08-05-2018

Re: Add python-pyelftools python package to Petalinux

Jump to solution

I am also working with OP-TEE, with PetaLinux 2018.2 & 2018.3.

I was able to get OP-TEE building on 3.5.0 by locking it by tag OPTEE_VERSION="3.5.0" and SRCREV="5df2a985b2ffd0b6f1107f12ca2a88203bf31328" being its git commit id, in both its bb and bb appends. xtest also needs to be 3.5.0 and SRCREV="e4f6f76b4cb5763112f4722981f84a26f4ac7e55".

Just in the last few days i needed to use OP-TEE 3.6.0 because of the new ftrace tool. I was able to get OP-TEE 3.6.0 to build doing the following on ubuntu 16.04:

First fixed my python pip - $ sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall

Second install pyelftools - $ pip3 install pyelftools

Third -

$ petalinux-build -x clean

$ petalinux-build -x distclean

$ petalinux-build -x mrproper 

After this i was able to build 3.6.0 with xtest passing. 

OPTEE_OS bb/bbapend:

OPTEE_VERSION ??= "3.6.0" 

SRCREV ??= "f398d4923da875370149ffee45c963d7adb41495"

OPTEE_TEST bb/bbapend:

OPTEE_VERSION ??= "3.6.0"
SRCREV ??="40aacb6dc33bbf6ee329f40274bfe7bb438bbf53"

 

Tags (3)
0 Kudos