[U-Boot] u-boot version

Detlev Zundel dzu at denx.de
Tue May 19 16:40:10 CEST 2009


Hi Deepak,

> Sorry for not being clear the first time around. My objective is to write a
> program with which i will be able to access the u-boot version. 

Form Linux that is I guess.  If you have CONFIG_VERSION_VARIABLE defined
in your U-Boot configuration, then according to README (see,
documentation can help sometimes):

- U-Boot Version:
                CONFIG_VERSION_VARIABLE
                If this variable is defined, an environment variable
                named "ver" is created by U-Boot showing the U-Boot
                version as printed by the "version" command.
                This variable is readonly.

This variable will also end up in the saved environment, (after at least
one saveenv), so you could use the "standard" fw_printenv tools in
tools/env/.

> Also i would like to add a new parameter to the bootstrap which would
> specify the bootstrap version.(which i want to according to changes i
> make to bootstrap)

You;d have to define what "a bootstrap" is for you.

> i assume that for this i will have to write a version string to the nand flash
> and then try to access it for the linux kernel....but thats just an idea...have
> no clue how to....

Well if "bootstrap" is e.g. a combination of a U-Boot version + a way to
boot Linux, you could simply pass an linux commandline option which is
not evaluated by the kernel itself, say "bootstrap=..".  In Linux you
can use /proc/cmdline to read the command line and find your switch,
voila.

Cheers
  Detlev

-- 
Q: Does that mean we also shouldn't be using IRQF_SAMPLE_RANDOM on
   interrupt [sources]?
A: Yes. The flag needs to be taken out and shot.
                            -- Matt Mackall <1239116251.14392.133.camel at calx>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list