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: 
Explorer
Explorer
5,937 Views
Registered: ‎07-17-2014

How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Hey all,

 

 I hope this is an easy question.

I'd like to include the print/set ENV tool found in:

 

<project>/build/linux/u-boot/src/u-boot-plnx/tools/env/

It's there. It just doesn't compile. how can I include it to get built and then included into the rootfs.

I didn't see anything in petalinux-config or -c rootfs that includes it.

little help?

thanks,

 -Ben

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
10,001 Views
Registered: ‎01-21-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry

View solution in original post

7 Replies
Xilinx Employee
Xilinx Employee
5,861 Views
Registered: ‎08-01-2008

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution
check this third party link it may help you
https://wiki.openwrt.org/doc/techref/bootloader/uboot.config
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Explorer
Explorer
5,843 Views
Registered: ‎07-17-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Hi there,


 Thanks -- but unfortunately, that link doesn't help me at all. I already know how to do all of what it says, PROVIDED the make scripts of PETALINUX were to somehow enable building fw_printenv and then including it into the PETALINUX rootfs when building a petalinux project.

SOMEwhere in a config or Makefile that PETALINUX controls/generates is the magic pixie dust I need to turn this on so that the right parms/commands are passed off to the build scripts for u-boot-plnx that at least compiles the env directory in tools.

Any thoughts there? (anyone?)

Thanks,

 -Ben

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
10,002 Views
Registered: ‎01-21-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry

View solution in original post

Explorer
Explorer
5,811 Views
Registered: ‎07-17-2014

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

@terryo wrote:

Hi Ben - I have never done this before, but it got me curious so I started looking around. 

 

I can get the tools to build with Petalinux with the following command: 

 

petalinux-build -c u-boot -x env_only

 

That will give you the fw_printenv program that you can test out. If it does, then you should be able to create a new application template that will just copy that file to the RFS.  In theory, you could bring the source for fw_printenv over into the application template and build it automatically on the Linux side, but I'm just not sure if the build process will "just work" or not. 

 

Take a look at UG1144 starting at section "Including Pre-built Applications." 

 

Please reply back and let me know if it works. 

 

Regards, 

Terry


Hi Terry!

That's what I needed! - I knew it was something simple.

I already have an "app" in my project where I can include startup scripts and other miscellaneous monkey business. So once the executable was available, I just copied it to that folder and edited my Makefile as needed.

Works like a charm (yes, I got /etc/fw_env.config all edited and included as well)

I did try a project and start including the source files. However, all the includes needed made it a hassle. I just needed a one time compile output.

Thanks again!

0 Kudos
Adventurer
Adventurer
3,607 Views
Registered: ‎09-27-2011

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Hello @bkamen.  Were you able to get fw_setenv working along with fw_printenv?  I have fw_printenv working, but if I try fw_setenv, it doesn't seem to know how to erase the partition before writing to it again and it causes the saved vars to go corrupt.  I am assuming it probably has to do with getting the correct compatibility setting in the device tree so that the correct driver loads.  Was wondering what your compatibility settings were and perhaps also what your fw_env.config file contains.

Thanks,

Joshua

0 Kudos
Visitor chriswampler
Visitor
456 Views
Registered: ‎05-03-2019

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

For petalinux 2019.1 this command doesn't seem to exist any more.

`petalinux-build -c u-boot -x env_only` produces

ERROR: Task do_env_only does not exist for target virtual/bootloader (/data/petalinux/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/u-boot/u-boot-xlnx_2019.1.bb:do_env_only)

 

I tried `petalinux-build -c u-boot -x listtasks` and env_only doesn't show up and I don't see anything else that matches that functionality.

What is the new method for producing fw_printenv?

 

Chris

 

0 Kudos
Visitor chriswampler
Visitor
405 Views
Registered: ‎05-03-2019

Re: How to include U-Boot's "fw_printenv" tool in Petalinux rootfs

Jump to solution

Found an answer to this on another forum.

https://forums.xilinx.com/t5/Embedded-Linux/How-to-include-U-Boot-s-quot-fw-printenv-quot-tool-in-Petalinux/td-p/770629

 

Add below line in <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf

IMAGE_INSTALL_append += " \
u-boot-fw-utils \ "

Tested this in 2017.4 and 2019.1 and it built fw_printenv and fw_setenv and made copies of the files in the rootfs at /sbin/fw_printenv.

 

0 Kudos