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!
11-11-2016 12:34 PM
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
11-14-2016 12:02 PM
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
11-13-2016 08:11 PM
11-14-2016 10:43 AM
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
11-14-2016 12:02 PM
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
11-14-2016 09:48 PM
@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!
07-17-2017 06:58 AM
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
09-04-2019 07:56 AM
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
09-06-2019 01:26 PM
Found an answer to this on another forum.
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.