Add environment call-back and flags capability
Get series with b4
b4 am 20121214160551.GB32034@bill-the-catVersions newest first · linked by author and title
- v5 Latest0 of 20 patches 0 repliesNew
- v40 of 20 patches 0 repliesSuperseded
Patches in v5 No applies recorded yet
None of the 20 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [U-Boot] [PATCH v5 0/20] Add environment call-back and flags capability
Quoted 135 lines · Joe Hershberger
When a variable with a registered callback is inserted, deleted, or overwritten the callback is called and gives the system an opportunity to do something in response to the change. It also has the opportunuty to reject the change by returning non-zero.
The flags on variables can control their type as well as their allowed access.
The format of the list is:
type_attribute= [s|d|x|b|i|m] attributes =type_attributeentry = variable_name[:attributes] list = entry[,list]The type attributes are:
s - String (default)
d - Decimal
x - Hexadecimal
b - Boolean ([1yYtT|0nNfF])
i - IP address
m - MAC addressThe access attributes are:
a - Any (default)
r - Read-only
o - Write-once
c - Change-defaultChanges in v5:
- Manually relocatechange_ok()pointer
- Add support forCONFIG_NEEDS_MANUAL_RELOCboards
- Fixed comment typo
- Fixed callbacks command help
- Compare current callback against pre-relocation address manually
- Fixed out-of-bounds array access inenv_flags_parse_vartype()
- Fixed out-of-bounds array access inenv_flags_parse_varaccess()Changes in v4:
- Prevent crash on relocation import
- Fixed help text
- Add help text for env flags command
- Add force support to setenv
- Implement deleteChanges in v3:
- Rebase onto Gerlando Falauto's env patches
- Refactorhimport_r()and hsearch_r()'s parameters
- Splithdelete_r()into the core delete and the validation before delete
- Delete vars on failed insertion
- Use Marek's linker lists instead of implementing it directly
- Rebase onto latest master
- Add flags parameter to callbacks
- Implement reverse search inenv_attr_lookup()
- Fix space skipping inenv_attr_lookup()
- All errors coming back fromhsearch_r()are no longer fatal. Don't abort import on failed ENTER action.
- Removed checkpatch.pl warningChanges in v2:
- Added much-needed documentation
- Factored out prevch and nextch inenv_attr_lookup()Joe Hershberger (20):
Make linux kernel string funcs available to tools
env: Refactordo_applyto a flag
env: Consolidate common code inhsearch_r()
env: Refactor apply intochange_ok
env: Usegetenv_yesno()more generally
env: Hide '.' variables in env print by default
env: Add support for callbacks to environment vars
env: Add a command to view callbacks
env: Add a bootfile env handler
env: Add a baudrate env handler
env: Add a loadaddr env handler
env: Add a console env handler
env: Add a silent env handler
env: Add environment variable flagstools/env: Add environment variable flags support
env: Add a command to display details about env flags
env: Add support for access control to .flags
env: Add setenv force support
env: Implement the env delete command
env: Handle write-once ethaddr and serial# genericallyREADME | 80 ++++++ arch/arm/lib/board.c | 4 +- arch/m68k/lib/board.c | 3 +- arch/microblaze/lib/board.c | 4 +- arch/powerpc/cpu/mpc85xx/mp.c | 4 +- arch/powerpc/lib/board.c | 9 +- arch/sparc/lib/board.c | 3 +- board/Marvell/db64360/db64360.c | 10 +- board/Marvell/db64460/db64460.c | 10 +- board/esd/cpci750/cpci750.c | 10 +- board/esd/pmc440/cmd_pmc440.c | 2 +- board/gw8260/gw8260.c | 10 +- board/prodrive/p3mx/p3mx.c | 10 +- common/Makefile | 6 + common/cmd_nvedit.c | 406 +++++++++++++++++------------ common/console.c | 75 +++++- common/env_attr.c | 229 ++++++++++++++++ common/env_callback.c | 144 +++++++++++ common/env_common.c | 61 +++-- common/env_dataflash.c | 2 +- common/env_eeprom.c | 2 +- common/env_fat.c | 2 +- common/env_flags.c | 560 ++++++++++++++++++++++++++++++++++++++++ common/env_flash.c | 4 +- common/env_mmc.c | 2 +- common/env_nand.c | 4 +- common/env_nvram.c | 2 +- common/env_onenand.c | 2 +- common/env_sf.c | 4 +- common/image.c | 21 +- doc/README.silent | 14 +- drivers/serial/serial.c | 70 +++++ include/common.h | 5 + include/env_attr.h | 55 ++++ include/env_callback.h | 75 ++++++ include/env_default.h | 8 + include/env_flags.h | 172 ++++++++++++ include/environment.h | 15 +- include/image.h | 1 - include/linux/linux_string.h | 8 + include/linux/string.h | 5 +- include/search.h | 37 ++- lib/Makefile | 1 + lib/hashtable.c | 244 +++++++++++------ lib/linux_string.c | 51 ++++ lib/string.c | 39 --- net/net.c | 49 ++-- tools/env/Makefile | 3 + tools/env/fw_env.c | 92 +++++-- 49 files changed, 2182 insertions(+), 447 deletions(-)
Quoted 8 lines
create mode 100644 common/env_attr.c create mode 100644 common/env_callback.c create mode 100644 common/env_flags.c create mode 100644 include/env_attr.h create mode 100644 include/env_callback.h create mode 100644 include/env_flags.h create mode 100644 include/linux/linux_string.h create mode 100644 lib/linux_string.c
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121214/620a9b9d/attachment.pgp>