Skip to contentSkip to conversation

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

U-Boot harsha kiran 3 participants 5 messages Nov 6, 2014

lore
Share & tools
lore
#0 lore raw

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-or-argument-from-command-line-to-build-u-boot-tp194962.html
Sent from the U-Boot mailing list archive at Nabble.com.

#1 lore raw
Quoted 4 lines · harsha kiran

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.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141106/09042b70/attachment.pgp>
#2 lore raw

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-or-argument-from-command-line-to-build-u-boot-tp194962p194969.html
Sent from the U-Boot mailing list archive at Nabble.com.

#3 lore raw

Hi harsha,

2014-11-07 1:43 GMT+09:00 harsha kiran <[email protected]>:

Quoted 8 lines

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

Quoted 6 lines

%_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 at oscar:~/workspace/u-boot$ git describe
v2014.07
masahiro at 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 at 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

=>

Signature · 2 lines
Best Regards
Masahiro Yamada