Skip to main content.
Navigation:
DENX
>
U-Boot
>
TaskEnvironmentGroups
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
U-Boot
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
U-Boot Home
Documentation
Source Code
The Custodians
Custodian Repositories
Development Process
Release Cycle
Coding Style
Patches
Tasks
Contacts
Changes
Index
List of pages in U-Boot
Search
---+ Group environment Variables: ---++ Rationale: In many cases the environment settings become so big that they are difficult to navigate and to change. It has been suggested that it would be nice if variables could be ordered into "groups" or "blocks", but it seems difficult to get an agreement what exactly these groupos should be. ---++ Suggested Implementation: The following idea attempts to be as little introsive to existing code as possible, while allowing maximum flexibility at the same time. Only a single new environment variable, =="env_groups"== has to be reserved for the implementation of this feature. It is suggested, that the ="env_"= variable prefix gets reserved for this, even though this is not necessary from the technical point of view. ="env_groups"= is intended to hold a list of variable names. The implementation of the ="printenv"= command needs to be changed such that it groups the output according to the names stored in this list. Example: <verbatim> => setenv env_groups env_net env_boot env_flash </verbatim> <verbatim> => setenv env_net ethaddr ipaddr serverip gatewayip netmask hostname => setenv env_boot bootfile fdt_file rd_file kernel_addr_r fdt_addr_r rd_addr_r => setenv env_flash kernel_addr fdt_addr rd_addr </verbatim> ="printenv"= would then first print the variables listed in these groups, like that (stripping off the ="env_"= prefix from the group name (if present): <verbatim> net: ==== ethaddr=00:D0:93:17:EB:68 ## Error: "gatewayip" not defined hostname=tqm5200s ipaddr=192.168.160.4 netmask=255.255.0.0 serverip=192.168.1.1 boot: ===== bootfile=tqm5200/uImage fdt_addr_r=b00000 fdt_file=tqm5200/tqm5200.dtb kernel_addr_r=900000 ## Error: "rd_addr_r" not defined ## Error: "rd_file" not defined flash: ====== fdt_addr=400000 kernel_addr=500000 rd_addr=800000 Other: ====== ... </verbatim> *Note 1:* I think it makes sense to raise errors as shown above for variables, that are undefined but listed as members of some group. *Note 2:* It is trivial to print just a the variables of a specific group by running for example: <verbatim> => printenv ${env_net} </verbatim> *Note 3:* If the [[TaskSetEnvironmentDefaults]["Set Environment to Default Values"]] feature gets implemented as suggested, it is also trivial to delete or reset all variables of a group to their built-in default values by running for example: <verbatim> => environment default ${env_net} => environment clear ${env_flash} </verbatim> ---+ Additional feature: It would be nice if variables in each group could be sorted alphabetically when they are printed using the ="printev"= command. -- Main.WolfgangDenk - 12 Oct 2008