uboot-tools: add fw_printenv, rename to uboot-tools
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 18 Jul 2011 13:22:13 +0000 (15:22 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 18 Jul 2011 13:27:52 +0000 (15:27 +0200)
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>
12 files changed:
boot/uboot/Config.in
boot/uboot/uboot.mk
linux/linux.mk
package/Config.in
package/uboot-mkimage/Config.in [deleted file]
package/uboot-mkimage/uboot-mkimage-2011.03-drop-configh.patch [deleted file]
package/uboot-mkimage/uboot-mkimage-2011.03-hostcflags-override-fix.patch [deleted file]
package/uboot-mkimage/uboot-mkimage.mk [deleted file]
package/uboot-tools/Config.in [new file with mode: 0644]
package/uboot-tools/uboot-tools-2011.03-drop-configh.patch [new file with mode: 0644]
package/uboot-tools/uboot-tools-2011.03-hostcflags-override-fix.patch [new file with mode: 0644]
package/uboot-tools/uboot-tools.mk [new file with mode: 0644]

index 070533efd7d2b2b1a0dff6f2f444d076fafd71bb..a0b2bfc8753308cb2550e7d290d573224d3a16b9 100644 (file)
@@ -91,11 +91,6 @@ config BR2_TARGET_UBOOT_FORMAT_LDR
 
 endchoice
 
-config BR2_TARGET_UBOOT_TOOL_ENV
-       bool "fw_printenv tool in target"
-       help
-         Install fw_printenv / fw_setenv tools in target.
-
 menuconfig BR2_TARGET_UBOOT_NETWORK
        bool "Network Settings"
        default y
index 0610e4c9dcf5feaea50083bef9b9ac7c53fd99eb..142557995d699860da06c85a640041cc319abb79 100644 (file)
@@ -78,35 +78,16 @@ define UBOOT_CONFIGURE_CMDS
        @echo "#endif /* __BR2_ADDED_CONFIG_H */" >> $(@D)/include/config.h
 endef
 
-ifeq ($(BR2_TARGET_UBOOT_TOOL_ENV),y)
-define UBOOT_BUILD_TARGET_ENV_UTILS
-       $(TARGET_CONFIGURE_OPTS) $(MAKE) HOSTCC="$(TARGET_CC)" -C $(@D) env
-endef
-endif
-
 define UBOOT_BUILD_CMDS
        $(TARGET_CONFIGURE_OPTS) $(UBOOT_CONFIGURE_OPTS)        \
                $(MAKE) -C $(@D) $(UBOOT_MAKE_OPTS)             \
                $(UBOOT_MAKE_TARGET)
-       $(UBOOT_BUILD_TARGET_ENV_UTILS)
 endef
 
 define UBOOT_INSTALL_IMAGES_CMDS
        cp -dpf $(@D)/$(UBOOT_BIN) $(BINARIES_DIR)/
 endef
 
-ifeq ($(BR2_TARGET_UBOOT_TOOL_ENV),y)
-define UBOOT_INSTALL_TARGET_ENV_UTILS
-       $(INSTALL) -m 0755 -D $(@D)/tools/env/fw_printenv \
-               $(TARGET_DIR)/usr/sbin/fw_printenv
-       ln -sf fw_printenv $(TARGET_DIR)/usr/sbin/fw_setenv
-endef
-endif
-
-define UBOOT_INSTALL_TARGET_CMDS
-       $(UBOOT_INSTALL_TARGET_ENV_UTILS)
-endef
-
 $(eval $(call GENTARGETS,boot,uboot))
 
 ifeq ($(BR2_TARGET_UBOOT),y)
index bdd8bb3e44885641af267718478dc3d76518f4ae..e6cf01aea05bf2c5cb9787d803450e01d396c2e9 100644 (file)
@@ -54,7 +54,7 @@ LINUX_IMAGE_NAME=vmImage
 else
 LINUX_IMAGE_NAME=uImage
 endif
-LINUX_DEPENDENCIES+=host-uboot-mkimage
+LINUX_DEPENDENCIES+=host-uboot-tools
 else ifeq ($(BR2_LINUX_KERNEL_BZIMAGE),y)
 LINUX_IMAGE_NAME=bzImage
 else ifeq ($(BR2_LINUX_KERNEL_ZIMAGE),y)
index db730ece6374080a1229c943f4d4328bb05d8e58..a01f8d2779157743076a7ac56a54ec565de19a32 100644 (file)
@@ -206,7 +206,7 @@ source "package/sredird/Config.in"
 source "package/sshfs/Config.in"
 source "package/statserial/Config.in"
 source "package/sysstat/Config.in"
-source "package/uboot-mkimage/Config.in"
+source "package/uboot-tools/Config.in"
 source "package/udev/Config.in"
 source "package/usb_modeswitch/Config.in"
 source "package/usbmount/Config.in"
diff --git a/package/uboot-mkimage/Config.in b/package/uboot-mkimage/Config.in
deleted file mode 100644 (file)
index e1dec53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-config BR2_PACKAGE_UBOOT_MKIMAGE
-       bool "uboot-mkimage"
-       help
-         The mkimage tool from Das U-Boot bootloader, which allows
-         generation of U-Boot images in various formats.
-
-         http://www.denx.de/wiki/U-Boot/WebHome
diff --git a/package/uboot-mkimage/uboot-mkimage-2011.03-drop-configh.patch b/package/uboot-mkimage/uboot-mkimage-2011.03-drop-configh.patch
deleted file mode 100644 (file)
index bf524c9..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-"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-mkimage/uboot-mkimage-2011.03-hostcflags-override-fix.patch b/package/uboot-mkimage/uboot-mkimage-2011.03-hostcflags-override-fix.patch
deleted file mode 100644 (file)
index 0202eda..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-[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-mkimage/uboot-mkimage.mk b/package/uboot-mkimage/uboot-mkimage.mk
deleted file mode 100644 (file)
index d8a8fbb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-UBOOT_MKIMAGE_VERSION = 2011.03
-UBOOT_MKIMAGE_SOURCE  = u-boot-$(UBOOT_MKIMAGE_VERSION).tar.bz2
-UBOOT_MKIMAGE_SITE    = ftp://ftp.denx.de/pub/u-boot
-
-define UBOOT_MKIMAGE_BUILD_CMDS
-       $(MAKE) -C $(@D)                        \
-               HOSTCC="$(TARGET_CC)"           \
-               HOSTCFLAGS="$(TARGET_CFLAGS)"   \
-               HOSTLDFLAGS="$(TARGET_LDFLAGS)" \
-               HOSTSTRIP=true                  \
-               tools
-endef
-
-define UBOOT_MKIMAGE_INSTALL_CMDS
-       install -m 0755 -D $(@D)/tools/mkimage $(TARGET_DIR)/usr/bin
-endef
-
-define HOST_UBOOT_MKIMAGE_BUILD_CMDS
-       $(MAKE) -C $(@D)                        \
-               HOSTCC="$(HOSTCC)"              \
-               HOSTCFLAGS="$(HOST_CFLAGS)"     \
-               HOSTLDFLAGS="$(HOST_LDFLAGS)"   \
-               tools
-endef
-
-define HOST_UBOOT_MKIMAGE_INSTALL_CMDS
-       install -m 0755 -D $(@D)/tools/mkimage $(HOST_DIR)/usr/bin
-endef
-
-$(eval $(call GENTARGETS,package,uboot-mkimage))
-$(eval $(call GENTARGETS,package,uboot-mkimage,host))
diff --git a/package/uboot-tools/Config.in b/package/uboot-tools/Config.in
new file mode 100644 (file)
index 0000000..f197391
--- /dev/null
@@ -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 (file)
index 0000000..bf524c9
--- /dev/null
@@ -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 (file)
index 0000000..0202eda
--- /dev/null
@@ -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 (file)
index 0000000..b9e0f21
--- /dev/null
@@ -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))