From 66abdde90cb03cfb95978d3b5fecb74110367b66 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 11 Aug 2014 11:51:45 +0200 Subject: add u-boot hosttools support, remove mkimage package --- package/u-boot/Makefile | 23 +++++++++----- package/u-boot/patches/patch-Kbuild | 45 +++++++++++++++++++++++++++ package/u-boot/patches/patch-Makefile | 57 +++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 package/u-boot/patches/patch-Kbuild create mode 100644 package/u-boot/patches/patch-Makefile (limited to 'package/u-boot') diff --git a/package/u-boot/Makefile b/package/u-boot/Makefile index 3511eb69a..fbdb3127d 100644 --- a/package/u-boot/Makefile +++ b/package/u-boot/Makefile @@ -4,27 +4,34 @@ include $(ADK_TOPDIR)/rules.mk PKG_NAME:= u-boot -PKG_VERSION:= 2014.01 +PKG_VERSION:= 2014.07 PKG_RELEASE:= 1 -PKG_MD5SUM:= e531307578f6d32a7ccb1d04f1e08cbc +PKG_MD5SUM:= 36d4bad687edcafa396fee607e505d4e PKG_DESCR:= bootloader PKG_SECTION:= base/boot PKG_URL:= http://www.denx.de/wiki/U-Boot PKG_SITES:= ftp://ftp.denx.de/pub/u-boot/ DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2 -PKG_CFLINE_U_BOOT:= depends on ADK_BROKEN PKG_SYSTEM_DEPENDS:= !cubox-i +PKG_CFLINE_U_BOOT:= depends on ADK_HOST_ONLY + +include $(ADK_TOPDIR)/mk/host.mk include $(ADK_TOPDIR)/mk/package.mk -$(eval $(call PKG_template,U_BOOT,u-boot,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call HOST_template,U_BOOT,u-boot,$(PKG_VERSION)-${PKG_RELEASE})) -CONFIG_STYLE:= manual +HOST_STYLE:= manual +HOST_MAKE_FLAGS+= HOST_TOOLS_ONLY=yes -do-configure: - echo "no config for your target available" +host-build: + (cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \ + ${HOST_MAKE_FLAGS} tools $(MAKE_TRACE) ) -u-boot-install: +u-boot-hostinstall: + ${INSTALL_BIN} ${WRKBUILD}/tools/mkimage \ + ${STAGING_HOST_DIR}/usr/bin +include ${ADK_TOPDIR}/mk/host-bottom.mk include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/u-boot/patches/patch-Kbuild b/package/u-boot/patches/patch-Kbuild new file mode 100644 index 000000000..7efe26e13 --- /dev/null +++ b/package/u-boot/patches/patch-Kbuild @@ -0,0 +1,45 @@ +Sometimes it is required to build only host U-Boot tools without building +U-Boot itself for either board. + +For example: + * In "buildroot" "uboot-tools" could be built for host just to have an ability + to create uImage. + * Linux distributions ship "mkimage" utility as a separate substance. + +This patch allows building host U-Boot tools separately from U-Boot itself and +what is more important user only needs to have host compiler (gcc). + +To build host tools just execute: +===== +make tools HOST_TOOLS_ONLY=yes +===== + +Without this patch to generate tools user needs: + 1. Configure any existing board with "make XXX_config" + 2. Execute tools building but still cross-compiler will be invoked and if + there's no proper cross-compiler in PATH compilation will fail. + +Signed-off-by: Alexey Brodkin + +Cc: Masahiro Yamada +Cc: Tom Rini +Cc: Simon Glass + +--- u-boot-2014.07.orig/Kbuild 2014-07-14 19:16:45.000000000 +0200 ++++ u-boot-2014.07/Kbuild 2014-08-11 10:06:13.311946939 +0200 +@@ -4,6 +4,9 @@ + # 1) Generate generic-asm-offsets.h + # 2) Generate asm-offsets.h + ++# Don't execute target below if building host tools only ++ifneq ($(HOST_TOOLS_ONLY),yes) ++ + ##### + # 1) Generate generic-asm-offsets.h + +@@ -85,3 +88,5 @@ arch/$(ARCH)/lib/asm-offsets.s: arch/$(A + + $(obj)/$(offsets-file): arch/$(ARCH)/lib/asm-offsets.s Kbuild + $(call cmd,offsets) ++ ++endif diff --git a/package/u-boot/patches/patch-Makefile b/package/u-boot/patches/patch-Makefile new file mode 100644 index 000000000..b2c069111 --- /dev/null +++ b/package/u-boot/patches/patch-Makefile @@ -0,0 +1,57 @@ +Sometimes it is required to build only host U-Boot tools without building +U-Boot itself for either board. + +For example: + * In "buildroot" "uboot-tools" could be built for host just to have an ability + to create uImage. + * Linux distributions ship "mkimage" utility as a separate substance. + +This patch allows building host U-Boot tools separately from U-Boot itself and +what is more important user only needs to have host compiler (gcc). + +To build host tools just execute: +===== +make tools HOST_TOOLS_ONLY=yes +===== + +Without this patch to generate tools user needs: + 1. Configure any existing board with "make XXX_config" + 2. Execute tools building but still cross-compiler will be invoked and if + there's no proper cross-compiler in PATH compilation will fail. + +Signed-off-by: Alexey Brodkin + +Cc: Masahiro Yamada +Cc: Tom Rini +Cc: Simon Glass + +--- u-boot-2014.07.orig/Makefile 2014-07-14 19:16:45.000000000 +0200 ++++ u-boot-2014.07/Makefile 2014-08-11 10:06:13.315946952 +0200 +@@ -483,9 +483,12 @@ ifeq ($(dot-config),1) + # load other configuration + include $(srctree)/config.mk + ++# Don't check for config.mk presence if building host tools only ++ifneq ($(HOST_TOOLS_ONLY),yes) + ifeq ($(wildcard include/config.mk),) + $(error "System not configured - see README") + endif ++endif + + # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use + # that (or fail if absent). Otherwise, search for a linker script in a +@@ -1055,10 +1058,14 @@ ifeq ($(CONFIG_SYS_GENERIC_BOARD),y) + @/bin/false + endif + endif ++ ++# Don't check for ldscript presence if building host tools only ++ifneq ($(HOST_TOOLS_ONLY),yes) + ifeq ($(wildcard $(LDSCRIPT)),) + @echo >&2 " Could not find linker script." + @/bin/false + endif ++endif + + archprepare: prepare1 scripts_basic + -- cgit v1.2.3