Skip to contentSkip to conversation

uboot: Allow fw env tools to be available as library

U-Boot Stefano Babic 1 participant 1 message Oct 26, 2018 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 49 lines · Richard OGrady

Hello,

You signed off on this patch awhile ago but I dont get how it creates a lib.a

https://lists.denx.de/pipermail/u-boot/2015-October/232337.html

Regards,

Rich OGrady

***************************************************************

Sometimes it can be useful to link the fw_ tools instead of having the fw_setenv/fw_printenv installed. Patch exports the tool as library and allowes to link it with own programs.

---
 tools/env/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/env/Makefile +3 -1
index 40164f7..38ad118 100644
@@ -23,10 +23,12 @@ endif
 always := fw_printenv
 hostprogs-y := fw_printenv
 
-fw_printenv-objs := fw_env.o fw_env_main.o \
+lib-y += fw_env.o \
 	crc32.o ctype.o linux_string.o \
 	env_attr.o env_flags.o aes.o
 
+fw_printenv-objs := fw_env_main.o $(lib-y)
+
 quiet_cmd_crosstools_strip = STRIP   $^
       cmd_crosstools_strip = $(STRIP) $^; touch $@
 
Signature · 3 lines
1.9.1

************************************************************

Library is built in tools/env. You have to rename it and install it on your own, for example I do this here:

https://github.com/sbabic/meta-swupdate/blob/master/recipes-bsp/u-boot/u-boot-fw-utils%25.bbappend

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================