[U-Boot] Custom configurations

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.
participants (1)
-
Jan Danielsson