mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-22 15:11:33 +00:00
U-Boot version environment variable "ver" added (CONFIG_VERSION_VARIABLE).
This commit is contained in:
parent
0db5bca807
commit
0587597ca3
2 changed files with 16 additions and 2 deletions
|
@ -180,9 +180,13 @@ int _do_setenv (int flag, int argc, char *argv[])
|
||||||
#ifndef CONFIG_ENV_OVERWRITE
|
#ifndef CONFIG_ENV_OVERWRITE
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ethernet Address and serial# can be set only once
|
* Ethernet Address and serial# can be set only once,
|
||||||
|
* ver is readonly.
|
||||||
*/
|
*/
|
||||||
if ( (strcmp (name, "serial#") == 0) ||
|
if ( (strcmp (name, "serial#") == 0) ||
|
||||||
|
#if defined(CONFIG_VERSION_VARIABLE)
|
||||||
|
(strcmp (name, "ver") == 0) ||
|
||||||
|
#endif /* CONFIG_VERSION_VARIABLE */
|
||||||
((strcmp (name, "ethaddr") == 0)
|
((strcmp (name, "ethaddr") == 0)
|
||||||
#if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
|
#if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR)
|
||||||
&& (strcmp (env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)
|
&& (strcmp (env_get_addr(oldval),MK_STR(CONFIG_ETHADDR)) != 0)
|
||||||
|
|
|
@ -279,6 +279,16 @@ void main_loop (void)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_MODEM_SUPPORT */
|
#endif /* CONFIG_MODEM_SUPPORT */
|
||||||
|
|
||||||
|
#ifdef CONFIG_VERSION_VARIABLE
|
||||||
|
{
|
||||||
|
extern char version_string[];
|
||||||
|
char *str = getenv("ver");
|
||||||
|
|
||||||
|
if (!str)
|
||||||
|
setenv ("ver", version_string); /* set version variable */
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_VERSION_VARIABLE */
|
||||||
|
|
||||||
#ifdef CFG_HUSH_PARSER
|
#ifdef CFG_HUSH_PARSER
|
||||||
u_boot_hush_start ();
|
u_boot_hush_start ();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue