Where fw_printenv is installed twice, and the second time it is installed as fw_setenv. I’m just checking this is correct and that fw_printenv allows you to set environment variables or is this a typo and should be:
install -m 755 {S}/tools/env/fw_setenv {D}${base_sbindir}/fw_setenv
This is correct, and is a small quirk of the fw_setenv/fw_getenv binary as it will look at the name of the binary upon execution and based on that provide the desired functionality.
Also note, depending a bit on which Yocto version you are using. We provide a recipe for this,
Thanks for clearing it up, I can see now that they are using the same codebase. Any reason why one isn’t a symlink to the other?
BTW: The auto-provided recipe compiled fw_printenv for the target and not the host. I tried to work out what was wrong but in the end I opted for a custom recipe. I had to use the following
EXTRA_OEMAKE_class-target = ‘CROSS_COMPILE={TARGET_PREFIX} CC="{CC} {CFLAGS} {LDFLAGS}" HOSTCC="{BUILD_CC} {BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1’
to get that to compile correctly. There is something odd about the vendor U-Boot that we are using I never got to the bottom of. Good news is that fw_printenv seems to be working as expected.