[U-Boot] Can i pass pass an environmental variable or argument from command line to build u-boot?

Hi !
For our project, we are trying to build the Bootloader with a Software partnumber. and i want it to be displayed on the first U-boot print..
U-Boot 2014.07 (Nov 05 2014 - 16:27:50) PN#12345678-001
I2C: ready DRAM: 256 MiB WARNING: Caches not enabled MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1 Using default environment
I was able to do this by adding the following in the boards.cfg file..
Active arm armv7 am33xx ti am335x_abb_uboot am335x_abb_uboot_npa_dev am335x_abb_uboot:SERIAL4,CONS_INDEX=4,NPA_DEV,IDENT_STRING="PN#12345678-001"
But i want to pass the IDENT_STRING from the command line to build the u-boot..the command i use is
sudo make ARCH=arm CROSS_COMPILE=/abb/compilers/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux/bin/arm-linux-gnueabihf- -j8 -s am335x_abb_uboot_npa_dev_config
is there a way i can pass this argument while building the u-boot?
Thanks, Harsha
-- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-... Sent from the U-Boot mailing list archive at Nabble.com.

On Thu, Nov 06, 2014 at 08:30:35AM -0700, harsha kiran wrote:
Hi !
For our project, we are trying to build the Bootloader with a Software partnumber. and i want it to be displayed on the first U-boot print..
Upgrade to current mainline and you can use CONFIG_LOCALVERSION for what you want.

Thanks Rini,
We have freeze the code base of bootloader for 2014-07 main line.
What can be another alternate approach? i was looking at the make file and i see that they take everything before _config and is sorted to find all the right pieces from boards.cfg file
%_config:: outputmakefile @$(MKCONFIG) -A $(@:_config=)
i was thinking to add something which can parse the Partnumber after the _config..i am not sure if its a good approach..
Thanks, Harsha
-- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-... Sent from the U-Boot mailing list archive at Nabble.com.

Hi harsha,
2014-11-07 1:43 GMT+09:00 harsha kiran kj.h.kiran@us.abb.com:
Thanks Rini,
We have freeze the code base of bootloader for 2014-07 main line.
What can be another alternate approach? i was looking at the make file and i see that they take everything before _config and is sorted to find all the right pieces from boards.cfg file
%_config:: outputmakefile @$(MKCONFIG) -A $(@:_config=)
i was thinking to add something which can parse the Partnumber after the _config..i am not sure if its a good approach..
Why don't you save your favorite version string into a file "localversion"? This feature is available in v2014.07.
masahiro@oscar:~/workspace/u-boot$ git describe v2014.07 masahiro@oscar:~/workspace/u-boot$ echo "PN#1234567" > localversion && make sandbox_config all Configuring for sandbox board... GEN include/autoconf.mk.dep GEN include/autoconf.mk CHK include/config/uboot.release UPD include/config/uboot.release CHK include/generated/version_autogenerated.h UPD include/generated/version_autogenerated.h CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h CC lib/asm-offsets.s GEN include/generated/generic-asm-offsets.h [ snip ] CC test/dm/ut.o CC test/dm/core.o CC test/dm/gpio.o LD test/dm/built-in.o LD u-boot OBJCOPY u-boot.srec OBJCOPY u-boot.bin masahiro@oscar:~/workspace/u-boot$ ./u-boot
U-Boot 2014.07PN#1234567 (Nov 07 2014 - 02:19:30)
DRAM: 128 MiB Using default environment
In: serial Out: lcd Err: lcd =>

Thank you guys.
This is exactly what i wanted.
Thanks, Harsha
-- View this message in context: http://u-boot.10912.n7.nabble.com/Can-i-pass-pass-an-environmental-variable-... Sent from the U-Boot mailing list archive at Nabble.com.
participants (3)
-
harsha kiran
-
Masahiro YAMADA
-
Tom Rini