mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [RFC] u-boot-tools: emmc support in fw_printenv/fw_setenv
Date: Fri, 8 Aug 2014 12:16:39 +0200	[thread overview]
Message-ID: <20140808101639.GA11487@pengutronix.de> (raw)
In-Reply-To: <53E0CE18.9060103@tqsc.de>

On Tue, Aug 05, 2014 at 02:29:12PM +0200, Markus Niebel wrote:
> Hello Bruno,
> 
> Am 04.08.2014 10:29, wrote Bruno Thomsen:
> > Provide read/write access to U-Boot environment stored in eMMC flash from Linux.
> > 
> > Access to U-Boot environment can be very useful; dual kernel/rootfs images, production default values, change kernel bootargs, etc.
> > 
> > Tested with U-Boot 2009.08 and 2013.04 on TQMa28.
> > 
> 
> Wouldn't it be better to rework the support for u-boot tools in general? (I know, this will be tricky, since
> U-Boot environment tools compilation is really an adventure). Also I think, we should use the same version of
> U-Boot tools as we use for the U-Boot itself.
> 
> What do you think?

I think it's a good idea.

> For reference here is an internal used version of the u-boot-tools Makefile (known to work with U-Boot versions from our BSP for TQMa53 / TQMa6x). Should work at least for U-Boot 2013.01 and 2013.04 You need to provide a target specific /etc/fw_env.config
> 
> 8<--------------------------------------------------------------------
> # -*-makefile-*-
> #
> # Copyright (C) 2012 by Andreas Bießmann <andreas@biessmann.de>
> #
> # See CREDITS for details about who has contributed to this project.
> #
> # For further information about the PTXdist project and license conditions
> # see the README file.
> #
> 
> #
> # We provide this package
> #
> PACKAGES-$(PTXCONF_U_BOOT_TOOLS) += u-boot-tools
> 
> #
> # Paths and names
> #
> U_BOOT_TOOLS_VERSION	:= $(U_BOOT_VERSION)
> U_BOOT_TOOLS_MD5	:= $(U_BOOT_MD5)
> U_BOOT_TOOLS		:= u-boot-$(U_BOOT_TOOLS_VERSION)
> U_BOOT_TOOLS_SUFFIX	:= tar.bz2
> U_BOOT_TOOLS_URL	:= http://ftp.denx.de/pub/u-boot/$(U_BOOT_TOOLS).$(U_BOOT_TOOLS_SUFFIX)
> U_BOOT_TOOLS_SOURCE	:= $(SRCDIR)/$(U_BOOT_TOOLS).$(U_BOOT_TOOLS_SUFFIX)

This can fail. Use '=' instead of ':=' for anything that uses U_BOOT*
variables (directly or indirectly).

> U_BOOT_TOOLS_DIR	:= $(BUILDDIR)/$(U_BOOT_TOOLS)

Set this to $(BUILDDIR)/u-boot-tools-$(U_BOOT_TOOLS_VERSION) ...

> U_BOOT_TOOLS_LICENSE	:= GPLv2
> 
> $(STATEDIR)/u-boot-tools.extract: $(STATEDIR)/u-boot.extract
> 	@$(call targetinfo)
> 	@$(call touch)
> 
> $(STATEDIR)/u-boot-tools.prepare: $(STATEDIR)/u-boot.prepare
> 	@$(call targetinfo)
> 	@$(call touch)

... and do the extract /prepare correctly. Anything else causes problems
when rebuilding individual packages.

Michael

> 
> # ----------------------------------------------------------------------------
> # Prepare
> # ----------------------------------------------------------------------------
> 
> U_BOOT_TOOLS_PATH	:= $(U_BOOT_PATH)
> # U_BOOT_TOOLS_MAKE_OPT	:= $(U_BOOT_MAKE_OPT) tools
> 
> U_BOOT_TOOLS_CONF_TOOL	:= NO
> U_BOOT_TOOLS_MAKE_OPT	:= \
> 	HOSTCC="$(BOOTLOADER_CROSS_COMPILE)gcc" \
> 	HOSTSTRIP="$(BOOTLOADER_CROSS_COMPILE)strip" \
> 	CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE) \
> 	tools
> 
> #	HOSTCC="$(CROSS_CC)" \
> #	HOSTSTRIP="$(CROSS_STRIP)" \
> #	tools
> 
> ifdef PTXCONF_U_BOOT_TOOLS_TOOL_ENV
> U_BOOT_TOOLS_MAKE_OPT	+= env
> endif
> 
> # ----------------------------------------------------------------------------
> # Install
> # ----------------------------------------------------------------------------
> 
> $(STATEDIR)/u-boot-tools.install:
> 	@$(call targetinfo)
> 	install -D $(U_BOOT_TOOLS_DIR)/tools/env/fw_printenv \
> 		$(U_BOOT_TOOLS_PKGDIR)/usr/sbin/fw_printenv
> 	@$(call touch)
> 
> # ----------------------------------------------------------------------------
> # Target-Install
> # ----------------------------------------------------------------------------
> 
> $(STATEDIR)/u-boot-tools.targetinstall:
> 	@$(call targetinfo)
> 
> 	@$(call install_init,  u-boot-tools)
> 	@$(call install_fixup, u-boot-tools,PRIORITY,optional)
> 	@$(call install_fixup, u-boot-tools,SECTION,base)
> 	@$(call install_fixup, u-boot-tools,AUTHOR,\
> 		"Andreas Bießmann <andreas@biessmann.de>")
> 	@$(call install_fixup, u-boot-tools,DESCRIPTION,missing)
> 
> ifdef PTXCONF_U_BOOT_TOOLS_TOOL_ENV
> 	@$(call install_copy, u-boot-tools, 0, 0, 0755, -, /usr/sbin/fw_printenv)
> 	@$(call install_link, u-boot-tools, fw_printenv, /usr/sbin/fw_setenv)
> 	@$(call install_alternative, u-boot-tools, 0, 0, 0644, /etc/fw_env.config)
> endif
> 
> 	@$(call install_finish, u-boot-tools)
> 
> 	@$(call touch)
> 
> $(STATEDIR)/u-boot-tools.clean:
> 	@$(call targetinfo)
> 	-rm $(STATEDIR)/u-boot-tools.*
> #	@$(call clean_pkg, U_BOOT_TOOLS)
> 
> # vim: syntax=make
> 8<--------------------------------------------------------------------
> 
> Regards
> 
> Markus
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2014-08-08 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04  8:29 Bruno Thomsen
2014-08-05 11:37 ` Markus Niebel
2014-08-05 12:29 ` Markus Niebel
2014-08-08 10:16   ` Michael Olbrich [this message]
2014-08-20  9:02     ` Bruno Thomsen
2014-08-25 10:09       ` Markus Niebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140808101639.GA11487@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox