public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jan Danielsson <jan.m.danielsson@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Custom configurations
Date: Wed, 30 Mar 2016 15:44:03 +0200	[thread overview]
Message-ID: <56FBD823.6030202@gmail.com> (raw)

Hello,

   Is there a way to pass a custom out-of-tree configuration to the
build system?

   This page seems to have an unofficial patch which outlines exactly
what we'd like to do:
https://boundarydevices.com/customizing-u-boot-on-i-mx/

   We have a script which builds an embedded system; it's possible to
pass an parameters to the build script to instruct it take different
build routes (build for different operating systems, hardware platforms,
etc, as well as development versions and production versions).

   I would like to be able to use a simple switch to the build script to
enable "tftp mode", which would mean that it builds all the necessary
files for booting from tftp, but more importantly, tell u-boot to
automatically initialize and boot from tftp.  Other factors play in as
well, like which system it is being built on.

   To illustrate (in short) what I would like to do:

   rm myconf.h
   if [ "$BOOTMODE" = "tftp" ]; then
     if [ "`hostname`" = "maindevsys" ]; then
       SERVERIP="10.101.20.12"
     else
       SERVERIP="`getselfip`"
     fi
     echo CONFIG_BOOTCOMMAND="setenv serverip $SERVERIP ; dhcp ;
tftpboot 0x10000000 uramdisk.image.gz ; tftpboot 0x13200000 uImage ;
tftpboot 0x16400000 zynq-zed.dtb ; bootm 0x13200000 0x10000000
0x16400000" >> ~/tmp/myconf.h
   fi
   [---]
   CUSTOM_CONFIG=~/rmp/myconf.h make zynq_picozed_config
   make

   (Ignore missing escapes etc; this is just for illustration).

   As you can see, the configuration can be pretty dynamic, so this
isn't something we'd like to host in a repository, and furthermore I
would prefer not to modify any in-tree files if possible (it's not a
problem for me to migrate our changes to a new official release branch,
but I'm trying to make this as simple as possible for whoever takes over
maintainership further down the road).

   I'd be surprised if others haven't encountered this need before; and
in place of the CUSTOM_CONFIG feature, what other solutions have people
come up with?

   The most straightforward solution, given the boundary conditions I
set up, would currently, to me, be to make a copy of the picozed config
and copy it into the include/configs directory, and make the appropriate
dynamic modifications in the non-scm tracked file.  This does however
put some extra burden on the person updating the u-boot version used in
the build.

   Looking for any helpful tips on how to accomplish this.

-- 
Kind Regards,
Jan

                 reply	other threads:[~2016-03-30 13:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=56FBD823.6030202@gmail.com \
    --to=jan.m.danielsson@gmail.com \
    --cc=u-boot@lists.denx.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