Skip to content
Snippets Groups Projects
Commit be683756 authored by Ruslan Trofymenko's avatar Ruslan Trofymenko Committed by Tom Rini
Browse files

cmd: part: Add 'number' sub-command


This sub-command serves for getting the partition index from
partition name. Also it can be used to test the existence of specified
partition.

Use case:
For example, in most CI environments this U-Boot command for automatic
testing of Linux rootfs is used:

    => setenv bootpart 1:f

where 0xf is "userdata" partition. But the number of "userdata"
partition can be changed any time, when partition table is changed.

So it would be nice to get rid of that 0xf magic number and use
partition name instead, like this:

    => part number mmc 1 userdata part_num
    => setenv bootpart 1:${part_num}

Signed-off-by: default avatarRuslan Trofymenko <ruslan.trofymenko@linaro.org>
Signed-off-by: default avatarIgor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: default avatarAlistair Strachan <astrachan@google.com>
Reviewed-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
parent fe424387
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment