Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add range check for variables #30

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 23, 2024

  1. Add range check for variables

    Add range check for variables using the ".flags" variable. Different
    types of ranges can be specified for strings, decimals and hex-values.
    
    - For string one can specify a regular expression for valid string.
    - For decimals one can specify an integer range
    - For hex values one can specify a bitmask
    
    The range is added by the '@' character after the access flags.
    
    Example:
    
    Environment:
    
    .flags=foo:sw@r"aaab+",bla:dw@100-200,blub:xw@0xffff
    foo=aaab
    bla=123
    blub=0x1234
    
    Commandline:
    
    $ fw_setenv foo aaac
    libuboot_set_env failed: -1
    
    $ fw_setenv foo aaabbbb
    $ fw_printenv
    bla=123
    blub=0x1234
    foo=aaabbb
    
    Signed-off-by: Lukas Funke <[email protected]>
    luckyfunky committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    58f756b View commit details
    Browse the repository at this point in the history