11 Jan, 2020

3 commits

  • Trying to extend 'adtimg' functionality [1], we've been severely hit
    by a major limitation in the command's usage scheme. Specifically, the
    command's user interface appears to be too centric to getting the
    DTB/DTBO entry [3] based on the index of the desired DT in the image,
    which makes it really difficult retrieving the DT entry based on
    alternative criteria (e.g. filtering by id/rev fields), the
    latter being demanded by real life customer use-cases [1].

    This went to the point of receiving below feedback from Sam [2]:

    -- snip --
    As for 'dtimg' command: after giving it some thought, I think not much
    people using it yet. So in this particular case I don't have some
    strong preference, and if you think the 'dtimg' interface is ugly, and
    it overcomes "don't break interfaces" rule, maybe now is a good time
    to rework it (before it gets widely used).
    -- snip --

    Given the above, rework the usage pattern from [4] to [5], in order to
    allow an intuitive enablement of "by id|rev" DT search [6].

    [1] https://patchwork.ozlabs.org/cover/1202575/
    ("cmd: dtimg: Enhance with --id and --rev options (take #1)")
    [2] https://patchwork.ozlabs.org/patch/1182207/#2317020
    [3] https://source.android.com/devices/architecture/dto/partitions
    [4] Old usage
    adtimg dump - Print image contents
    adtimg start - Get DT address by index
    adtimg size - Get DT size by index

    [5] New usage
    adtimg addr - Set image location to
    adtimg dump - Print out image contents
    adtimg get dt --index= [avar [svar]] - Get DT address and size by index

    [6] Soon-to-be-provided "by id|rev" add-on functionality
    adtimg get dt --id= --rev= [avar [svar [ivar]]]
    - Get DT address/size/index by id|rev fields

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Sam Protsenko

    Eugeniu Rosca
     
  • With 'dtimg.c' renamed to 'adtimg.c', now ensure the naming
    consistency in the internal implementation of 'adtimg.c'.

    No functional change intended.

    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Sam Protsenko
    Reviewed-by: Simon Glass

    Eugeniu Rosca
     
  • Rename the existing 'dtimg' command to 'adtimg', in order to:
    - Suggest the Android origins and scope
    - Be consistent with the upcoming 'abootimg' command (naming
    suggested by Simon [*])

    The change in _not_ backward compatible, but its benefits outweigh its
    downsides, given that we don't expect active users of 'dtimg' today.

    Perform the rename in several steps:
    1. Rename *.c file and Kconfig symbol. This should allow
    'git log --follow' to properly track the history of 'adtimg.c'
    2. 's/dtimg/adtimg/g' in the internal namespace of 'adtimg.c'

    ELF comparison [**] before and after shows no functional change.

    [*] https://patchwork.ozlabs.org/patch/1182212/#2291600
    [**] diff -u
    Signed-off-by: Eugeniu Rosca
    Reviewed-by: Simon Glass
    Reviewed-by: Sam Protsenko

    Eugeniu Rosca