summaryrefslogtreecommitdiffstats
path: root/package/uboot-tools
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-07-18 15:22:13 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-07-18 15:27:52 +0200
commit7a2fa1f8db5c2e627a4b939862af5f938fcfc359 (patch)
tree493a2520b34487f2c983b69a2f6775784d6ad9cf /package/uboot-tools
parent1dfc43cced8d30984687950beca6448203fb576d (diff)
downloadbuildroot-novena-7a2fa1f8db5c2e627a4b939862af5f938fcfc359.tar.gz
buildroot-novena-7a2fa1f8db5c2e627a4b939862af5f938fcfc359.zip
uboot-tools: add fw_printenv, rename to uboot-tools
Move fw_printenv / fw_setenv options from the uboot bootloader build to the uboot-mkimage package, and rename it to uboot-tools. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/uboot-tools')
-rw-r--r--package/uboot-tools/Config.in23
-rw-r--r--package/uboot-tools/uboot-tools-2011.03-drop-configh.patch27
-rw-r--r--package/uboot-tools/uboot-tools-2011.03-hostcflags-override-fix.patch29
-rw-r--r--package/uboot-tools/uboot-tools.mk55
4 files changed, 134 insertions, 0 deletions
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
new file mode 100644
index 000000000..f19739150
--- /dev/null
+++ b/package/uboot-tools/Config.in
@@ -0,0 +1,23 @@
+config BR2_PACKAGE_UBOOT_TOOLS
+ bool "u-boot tools"
+ help
+ Companion tools for Das U-Boot bootloader.
+
+ http://www.denx.de/wiki/U-Boot/WebHome
+
+if BR2_PACKAGE_UBOOT_TOOLS
+
+config BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE
+ bool "mkimage"
+ help
+ The mkimage tool from Das U-Boot bootloader, which allows
+ generation of U-Boot images in various formats.
+
+config BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
+ bool "fw_printenv"
+ help
+ The fw_printenv / fw_setenv tools from Das U-Boot
+ bootloader, which allows access to the U-Boot environment
+ from Linux.
+
+endif
diff --git a/package/uboot-tools/uboot-tools-2011.03-drop-configh.patch b/package/uboot-tools/uboot-tools-2011.03-drop-configh.patch
new file mode 100644
index 000000000..bf524c9a3
--- /dev/null
+++ b/package/uboot-tools/uboot-tools-2011.03-drop-configh.patch
@@ -0,0 +1,27 @@
+"make tools-all" should allow building tools such as mkimage and the new
+imximage without any config, but imximage.c currently fails to build
+with:
+imximage.h:27:20: error: config.h: No such file or directory
+
+config.h is not needed in imximage.h nor in imximage.c, and imximage.h
+is only included from imximage.c, so drop this include to fix the build.
+
+Signed-off-by: Lo?c Minier <loic.minier@linaro.org>
+---
+ tools/imximage.h | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/tools/imximage.h b/tools/imximage.h
+index 38ca6be..d126a46 100644
+--- a/tools/imximage.h
++++ b/tools/imximage.h
+@@ -24,8 +24,6 @@
+ #ifndef _IMXIMAGE_H_
+ #define _IMXIMAGE_H_
+
+-#include <config.h>
+-
+ #define MAX_HW_CFG_SIZE_V2 121 /* Max number of registers imx can set for v2 */
+ #define MAX_HW_CFG_SIZE_V1 60 /* Max number of registers imx can set for v1 */
+ #define APP_CODE_BARKER 0xB1
+-- 1.7.2.3
diff --git a/package/uboot-tools/uboot-tools-2011.03-hostcflags-override-fix.patch b/package/uboot-tools/uboot-tools-2011.03-hostcflags-override-fix.patch
new file mode 100644
index 000000000..0202eda9b
--- /dev/null
+++ b/package/uboot-tools/uboot-tools-2011.03-hostcflags-override-fix.patch
@@ -0,0 +1,29 @@
+[PATCH] Fix tools build with custom HOSTCFLAGS
+
+We always need to append HOSTCPPFLAGS, even if HOSTCFLAGS have been
+overridden on the cmdline.
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ config.mk | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+Index: u-boot-2011.03/config.mk
+===================================================================
+--- u-boot-2011.03.orig/config.mk
++++ u-boot-2011.03/config.mk
+@@ -46,10 +46,12 @@
+
+ #########################################################################
+
+-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
+- $(HOSTCPPFLAGS)
++HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTSTRIP = strip
+
++# append CPPFLAGS even if CFLAGS has been overridden on cmdline
++override HOSTCFLAGS += $(HOSTCPPFLAGS)
++
+ #
+ # Mac OS X / Darwin's C preprocessor is Apple specific. It
+ # generates numerous errors and warnings. We want to bypass it
diff --git a/package/uboot-tools/uboot-tools.mk b/package/uboot-tools/uboot-tools.mk
new file mode 100644
index 000000000..b9e0f215b
--- /dev/null
+++ b/package/uboot-tools/uboot-tools.mk
@@ -0,0 +1,55 @@
+UBOOT_TOOLS_VERSION = 2011.03
+UBOOT_TOOLS_SOURCE = u-boot-$(UBOOT_TOOLS_VERSION).tar.bz2
+UBOOT_TOOLS_SITE = ftp://ftp.denx.de/pub/u-boot
+
+define UBOOT_TOOLS_BUILD_CMDS
+ $(MAKE) -C $(@D) \
+ HOSTCC="$(TARGET_CC)" \
+ HOSTCFLAGS="$(TARGET_CFLAGS)" \
+ HOSTLDFLAGS="$(TARGET_LDFLAGS)" \
+ HOSTSTRIP=true \
+ tools env
+endef
+
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
+define UBOOT_TOOLS_INSTALL_MKIMAGE
+ install -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV),y)
+define UBOOT_TOOLS_INSTALL_FWPRINTENV
+ install -m 0755 -D $(@D)/tools/env/fw_printenv $(TARGET_DIR)/usr/sbin
+ ln -sf fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv
+endef
+endif
+
+define UBOOT_TOOLS_INSTALL_TARGET_CMDS
+ $(UBOOT_TOOLS_INSTALL_MKIMAGE)
+ $(UBOOT_TOOLS_INSTALL_FWPRINTENV)
+endef
+
+define UBOOT_TOOLS_UNINSTALL_TARGET_CMDS
+ rm -f $(addprefix $(TARGET_DIR)/,\
+ usr/bin/mkimage usr/sbin/fw_printenv usr/sbin/fw_setenv)
+endef
+
+
+define BUSYBOX_UNINSTALL_TARGET_CMDS
+ $(BUSYBOX_MAKE_ENV) $(MAKE) $(BUSYBOX_MAKE_OPTS) -C $(@D) uninstall
+endef
+
+define HOST_UBOOT_TOOLS_BUILD_CMDS
+ $(MAKE1) -C $(@D) \
+ HOSTCC="$(HOSTCC)" \
+ HOSTCFLAGS="$(HOST_CFLAGS)" \
+ HOSTLDFLAGS="$(HOST_LDFLAGS)" \
+ tools
+endef
+
+define HOST_UBOOT_TOOLS_INSTALL_CMDS
+ install -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/usr/bin
+endef
+
+$(eval $(call GENTARGETS,package,uboot-tools))
+$(eval $(call GENTARGETS,package,uboot-tools,host))