Skip to contentSkip to conversation

svn commit: trunk/buildroot/target/u-boot

Buildroot jacmet at uclibc.org 2 participants 4 messages Apr 23, 2008

lore
Share & tools
lore
#0 lore raw

Author: jacmet
Date: 2008-04-23 06:03:53 -0700 (Wed, 23 Apr 2008) New Revision: 21809

Log:
u-boot: tools in target (mkimage, fw_printenv and fw_setenv)

Modified:
trunk/buildroot/target/u-boot/Config.in
trunk/buildroot/target/u-boot/Makefile.in

Changeset:
Modified: trunk/buildroot/target/u-boot/Config.in
===================================================================

buildroot/target/u-boot/Config.in +12 -0
@@ -70,3 +70,15 @@
 	help
 	  If the option has been enabled, the output can be
 	  silenced by setting the environment variable "silent".
+
+config BR2_TARGET_UBOOT_TOOL_MKIMAGE
+	bool "mkimage tool in target"
+	depends on BR2_TARGET_UBOOT
+	help
+	  Install mkimage tool in target.
+
+config BR2_TARGET_UBOOT_TOOL_ENV
+	bool "fw_printenv tool in target"
+	depends on BR2_TARGET_UBOOT
+	help
+	  Install fw_printenv / fw_setenv tools in target.

Modified: trunk/buildroot/target/u-boot/Makefile.in
===================================================================

buildroot/target/u-boot/Makefile.in +23 -2
@@ -20,6 +20,15 @@
 U_BOOT_INC_CONF_FILE:=$(U_BOOT_DIR)/include/config.h
 endif
 
+U_BOOT_TARGET_TOOLS:=
+ifeq ($(strip $(BR2_TARGET_UBOOT_TOOL_MKIMAGE)),y)
+U_BOOT_TARGET_TOOLS+=$(TARGET_DIR)/usr/bin/mkimage
+endif
+ifeq ($(strip $(BR2_TARGET_UBOOT_TOOL_ENV)),y)
+U_BOOT_TARGET_TOOLS+=$(TARGET_DIR)/usr/sbin/fw_printenv
+endif
+
+
 # Define a helper function
 define insert_define
 @echo "#ifdef $(strip $(1))" >> $(U_BOOT_INC_CONF_FILE)
@@ -113,11 +122,23 @@
 	cp -dpf $(U_BOOT_DIR)/$(U_BOOT_BIN) $(BINARIES_DIR)
 	cp -dpf $(U_BOOT_DIR)/tools/$(U_BOOT_TOOLS_BIN) $(STAGING_DIR)/usr/bin/
 
-u-boot: gcc $(BINARIES_DIR)/$(U_BOOT_BIN)
+$(TARGET_DIR)/usr/bin/mkimage: $(U_BOOT_DIR)/$(U_BOOT_BIN)
+	$(TARGET_CC) -I$(U_BOOT_DIR)/include -DUSE_HOSTCC -o $@ \
+		$(U_BOOT_DIR)/tools/mkimage.c $(U_BOOT_DIR)/tools/crc32.c
+	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
 
+$(TARGET_DIR)/usr/sbin/fw_printenv: $(U_BOOT_DIR)/$(U_BOOT_BIN)
+	$(TARGET_CC) -I$(U_BOOT_DIR)/include -I$(LINUX_HEADERS_DIR)/include \
+		-DUSE_HOSTCC -o $@ \
+		$(U_BOOT_DIR)/tools/env/*.c $(U_BOOT_DIR)/tools/crc32.c
+	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) $@
+	ln -s fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv
+
+u-boot: gcc $(BINARIES_DIR)/$(U_BOOT_BIN) $(U_BOOT_TARGET_TOOLS)
+
 u-boot-clean:
 	-$(MAKE) -C $(U_BOOT_DIR) clean
-	rm -f $(STAGING_DIR)/usr/bin/$(U_BOOT_TOOLS_BIN)
+	rm -f $(STAGING_DIR)/usr/bin/$(U_BOOT_TOOLS_BIN) $(U_BOOT_TARGET_TOOLS)
 
 u-boot-dirclean:
 	rm -rf $(U_BOOT_DIR)
#1 lore raw
Quoted 8 lines

Author: jacmet
Date: 2008-04-23 06:03:53 -0700 (Wed, 23 Apr 2008) New Revision: 21809

Log:
u-boot: tools in target (mkimage, fw_printenv and fw_setenv)

Why install mkimage in the target???
It is used to create the linux kernel image so that U-Boot can load it. If you download a new image, I would expect it is already created using mkimage on the host.

Quoted 5 lines

Modified:
trunk/buildroot/target/u-boot/Config.in
trunk/buildroot/target/u-boot/Makefile.in

Best Regards
Ulf Samuelsson

#2 lore raw
Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Ulf" == Ulf Samuelsson <[email protected]> writes:

Author: jacmet
Date: 2008-04-23 06:03:53 -0700 (Wed, 23 Apr 2008) New Revision: 21809

Log:
u-boot: tools in target (mkimage, fw_printenv and fw_setenv)

Ulf> Why install mkimage in the target???

To create images and more importantly, to see the version info of images in the flash (mkimage -l).

Ulf> It is used to create the linux kernel image so that U-Boot can load it. Ulf> If you download a new image, I would expect it is already created Ulf> using mkimage on the host.

Sure, but uImages are not just for kernels, E.G. the board I'm working on has firmware for 2 fpgas in seperate uImages. It's handy to be able to check the version info of the installed images under Linux, similar to the imls u-boot command.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw
Quoted 5 lines

Ulf> Why install mkimage in the target???

To create images and more importantly, to see the version info of images in the flash (mkimage -l).

Quoted 9 lines

Ulf> It is used to create the linux kernel image so that U-Boot can load it. Ulf> If you download a new image, I would expect it is already created Ulf> using mkimage on the host.

Sure, but uImages are not just for kernels, E.G. the board I'm working on has firmware for 2 fpgas in seperate uImages. It's handy to be able to check the version info of the installed images under Linux, similar to the imls u-boot command.

OK, that makes sense.
You learn something every day.

Quoted 3 lines
Signature · 1 line
Bye, Peter Korsgaard

Best Regards
Ulf Samuelsson