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: 
5,520 Views
Registered: ‎02-07-2008

Adding packages to PetaLinux

Jump to solution

Hi,

 

I am having trouble adding certain packages to a PetaLinux 2017.2 build. For example, when I need the "mount" command, I enable it in the menuconfig using petalinux-config -c rootfs and it becomes available from the Linux command line. That works fine, but some other packages don't seem to become available and I don't understand why.

 

Specifically, I'm now enabling the "ethtool" command, but when I try to call it from the Linux command line, I get "command not found". In case it was not in the path, I have tried to find it using find / -name "ethtool" but that does not return any results. When I search through the PetaLinux build files on my PC, I find the ethtool source code and object files, so I'm quite sure that it is getting included into the build. I have tried re-building and building from scratch several times.

 

I have also had the same problem with the "blkid" command.

 

Is there something that I should be doing that I'm not doing?

 

Thanks.

 

Jeff

0 Kudos
1 Solution

Accepted Solutions
7,099 Views
Registered: ‎02-07-2008

Re: Adding packages to PetaLinux

Jump to solution

I have found the cause of my problem and I am documenting it here for anyone else who might have the same issue.

 

Firstly, I realized that ethtool (or whatever package) was not getting build into the rootfs by looking for it in the /images/linux/rootfs.tar.gz file. Knowing this allowed me to do some tests and stumble across my error pretty quickly.

 

I use a scripted build and my flow was the cause of my problem. Here were my steps:

 

petalinux-create --type project --template zynq --name project_name
petalinux-config --get-hw-description <path-to-exported-hw> --oldconfig
<copy meta-user recipe files into the project including /project-spec/configs/rootfs_config>
petalinux-build

My mistake here was to assume that the PetaLinux tools would take my configuration files into account when I ran petalinux-build. In my experience, the tools actually do take most of the files into account using this method, but not the rootfs_config file. I found that in order for the tools to take the rootfs_config file into account, I needed to run petalinux-config again after copying the files into the project. Here is my new flow:

 

petalinux-create --type project --template zynq --name project_name
petalinux-config --get-hw-description <path-to-exported-hw> --oldconfig
<copy meta-user recipe files into the project including /project-spec/configs/rootfs_config>
petalinux-config --oldconfig
petalinux-build

Now I am able to find ethtool and all packages in the rootfs and call them from the command line as expected.

 

I hope this is useful to someone.

 

Jeff

 

 

View solution in original post

0 Kudos
3 Replies
Moderator
Moderator
5,451 Views
Registered: ‎12-04-2016

Re: Adding packages to PetaLinux

Jump to solution

Hi Jeff

 

Can you please try referring to this user guide to get some insight on adding packages to rootfs:

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

 

(Refer:- Steps to Build User Applications)

 

Kindly get back to me if you still faces the issues

 

 

Best Regards

Shabbir

0 Kudos
5,432 Views
Registered: ‎02-07-2008

Re: Adding packages to PetaLinux

Jump to solution

Hi Shabbir,

 

Unfortunately the reference guide does not talk about adding packages from the menuconfig petalinux-config -c rootfs.

 

I am not trying to add a "user application", I am adding packages that are built into Linux. In the menuconfig, we can tick the packages that we want to include. I'm saying that when I tick certain applications, they don't actually get built into PetaLinux.

 

connecting_ssd_to_fpga_running_petalinux_112

 

In the above image, I tick "util-linux-mount" so that I can use the "mount" command in PetaLinux. That works fine. But other packages don't seem to get built-in, even if I tick them - for example "ethtool" and "blkid".

 

Jeff

 

0 Kudos
7,100 Views
Registered: ‎02-07-2008

Re: Adding packages to PetaLinux

Jump to solution

I have found the cause of my problem and I am documenting it here for anyone else who might have the same issue.

 

Firstly, I realized that ethtool (or whatever package) was not getting build into the rootfs by looking for it in the /images/linux/rootfs.tar.gz file. Knowing this allowed me to do some tests and stumble across my error pretty quickly.

 

I use a scripted build and my flow was the cause of my problem. Here were my steps:

 

petalinux-create --type project --template zynq --name project_name
petalinux-config --get-hw-description <path-to-exported-hw> --oldconfig
<copy meta-user recipe files into the project including /project-spec/configs/rootfs_config>
petalinux-build

My mistake here was to assume that the PetaLinux tools would take my configuration files into account when I ran petalinux-build. In my experience, the tools actually do take most of the files into account using this method, but not the rootfs_config file. I found that in order for the tools to take the rootfs_config file into account, I needed to run petalinux-config again after copying the files into the project. Here is my new flow:

 

petalinux-create --type project --template zynq --name project_name
petalinux-config --get-hw-description <path-to-exported-hw> --oldconfig
<copy meta-user recipe files into the project including /project-spec/configs/rootfs_config>
petalinux-config --oldconfig
petalinux-build

Now I am able to find ethtool and all packages in the rootfs and call them from the command line as expected.

 

I hope this is useful to someone.

 

Jeff

 

 

View solution in original post

0 Kudos