cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jhon
Participant
Participant
842 Views
Registered: ‎11-27-2018

How to add/include can-utils in to Petalinux build 2018.2?

I want to build can-utils into Petalinux 2018.2, I find a post to do the same work in a older Peltalinux build:

https://forums.xilinx.com/t5/Embedded-Linux/How-to-add-include-canutils-in-to-Petalinux-build/td-p/778034

In the post, source code is downloaded from git:

and petalinux-create command is used to create an empty user application, and copy can-utils source code into the folder:

  • petalinux-create -t apps --template autoconf --name can-utils --enable

but the folder structure of the user application is diffrent in 2018.2, I'm not familiar with this, and don't know how to configure and make the project.

Could anyone give me some instructions?

0 Kudos
3 Replies
hokim
Scholar
Scholar
834 Views
Registered: ‎10-21-2015

Hi

Petalinux already has can-utils recipe

$ find /opt/petalinux/2018.2/components/yocto/source/aarch64/layers -name 'can-utils*'
/opt/petalinux/2018.2/components/yocto/source/aarch64/layers/meta-openembedded/meta-oe/recipes-extended/socketcan/can-utils_git.bb

If you want some modification on it, it's better to write bbappend.

0 Kudos
jhon
Participant
Participant
815 Views
Registered: ‎11-27-2018

Thank you hokim, I checked my installation and found there are 3 related files: canutils_4.0.6.bb  can-utils_git.bb  libsocketcan_0.0.10.bb

but I still don't know how to integrate them into my project, I can't find any branchs via petalinux-config -c kernel or rootfs. Could you give me some further instructions? I don't need any modifications to the source code.

Thanks!

0 Kudos
hokim
Scholar
Scholar
801 Views
Registered: ‎10-21-2015

Hi

can-utils_git.bb  fetches source code from https://github.com/linux-can/can-utils/tree/4c8fb05cb4d6ddcd67299008db54af423f86fd05

can-utils is not found in petalinux-config -c rootfs

You can add can-utils to rootfs by creating or modifying petalinux-user-image.bbappend like this

<petalinux-project>/project-spec/meta-user/recipes-core/images/petalinux-user-image.bbappend

IMAGE_INSTALL_append = " can-utils-dev"
0 Kudos