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: NRuslan Trofymenko <ruslan.trofymenko@linaro.org> Signed-off-by: NIgor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: NAlistair Strachan <astrachan@google.com> Reviewed-by: NSam Protsenko <semen.protsenko@linaro.org> Reviewed-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NSam Protsenko <semen.protsenko@linaro.org>
Showing
想要评论请 注册 或 登录