From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-wi0-f178.google.com ([209.85.212.178]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1SYzIN-00089s-5t for ptxdist@pengutronix.de; Mon, 28 May 2012 14:43:50 +0200 Received: by wibhn6 with SMTP id hn6so1222277wib.7 for ; Mon, 28 May 2012 05:43:25 -0700 (PDT) From: "Bart vdr. Meulen" Date: Mon, 28 May 2012 14:42:38 +0200 Message-Id: <1338208981-8681-12-git-send-email-bartvdrmeulen@gmail.com> Subject: [ptxdist] [PATCH] u-boot: Add option to install u-boot environment tools on target Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Ivo Sieben From: Remy Bohmer Add config option that can be used to install u-boot tools on target Current tools that can be selected: - fw_setenv - fw_printenv - gen_eth_addr Signed-off-by: Remy Bohmer Signed-off-by: Ivo Sieben --- platforms/u-boot.in | 6 ++++++ rules/u-boot.make | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/platforms/u-boot.in b/platforms/u-boot.in index e5401d6..f3a7a63 100644 --- a/platforms/u-boot.in +++ b/platforms/u-boot.in @@ -79,5 +79,11 @@ config U_BOOT_INSTALL_U_BOOT_IMG endif +config U_BOOT_INSTALL_TOOLS + prompt "install u-boot userspace tools" + bool + help + Installs the u-boot user space tools (fw_printenv, fw_setenv & + gen_eth_addr) tools in the target image. endif diff --git a/rules/u-boot.make b/rules/u-boot.make index 36760ee..7ab9959 100644 --- a/rules/u-boot.make +++ b/rules/u-boot.make @@ -50,11 +50,30 @@ $(STATEDIR)/u-boot.prepare: @$(call touch) # ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +$(STATEDIR)/u-boot.compile: + @$(call targetinfo) + @$(call world/compile,U_BOOT) +ifdef PTXCONF_U_BOOT_INSTALL_TOOLS + @cd $(U_BOOT_DIR) && make env CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) HOSTCC=$(PTXCONF_GNU_TARGET)-gcc + @cd $(U_BOOT_DIR) && make eth CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) HOSTCC=$(PTXCONF_GNU_TARGET)-gcc +endif + @$(call touch) + +# ---------------------------------------------------------------------------- # Install # ---------------------------------------------------------------------------- $(STATEDIR)/u-boot.install: @$(call targetinfo) +ifdef PTXCONF_U_BOOT_INSTALL_TOOLS + @mkdir -p $(U_BOOT_PKGDIR)/usr/bin/ $(U_BOOT_PKGDIR)/etc/ + @install -D -m 755 $(U_BOOT_DIR)/tools/env/fw_printenv $(U_BOOT_PKGDIR)/usr/bin/ + @ln -sf fw_printenv $(U_BOOT_PKGDIR)/usr/bin/fw_setenv + @install -D -m 755 $(U_BOOT_DIR)/tools/eth/gen_eth_addr $(U_BOOT_PKGDIR)/usr/bin/ +endif @$(call touch) # ---------------------------------------------------------------------------- @@ -76,6 +95,21 @@ endif ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_IMG @install -D -m644 $(U_BOOT_DIR)/u-boot.img $(IMAGEDIR)/u-boot.img endif + +ifdef PTXCONF_U_BOOT_INSTALL_TOOLS + @$(call install_init, u-boot) + @$(call install_fixup, u-boot,PRIORITY,optional) + @$(call install_fixup, u-boot,SECTION,base) + @$(call install_fixup, u-boot,AUTHOR,"Remy Bohmer ") + @$(call install_fixup, u-boot,DESCRIPTION,missing) + + @$(call install_copy, u-boot, 0, 0, 0755, -, /usr/bin/fw_printenv) + @$(call install_link, u-boot, fw_printenv, /usr/bin/fw_setenv) + @$(call install_copy, u-boot, 0, 0, 0755, -, /usr/bin/gen_eth_addr) + + @$(call install_finish, u-boot) +endif + @$(call touch) # ---------------------------------------------------------------------------- -- 1.7.9.5 -- ptxdist mailing list ptxdist@pengutronix.de