[U-Boot] [U-Boot, 1/3] cmd: part: Allow passing partition name to start and size

Tom Rini trini at konsulko.com
Wed Mar 14 14:09:44 UTC 2018


On Mon, Feb 26, 2018 at 11:17:59PM +0200, Sam Protsenko wrote:

> Allow passing the partition name to "part start" and "part size"
> commands, so we can avoid magic numbers in the environment.
> 
> Consider one real use-case: in include/environment/ti/boot.h we have
> commands like these:
> 
>     setenv boot_part 9
>     part start mmc ${mmcdev} ${boot_part} boot_start
>     part size mmc ${mmcdev} ${boot_part} boot_size
>     mmc read ${loadaddr} ${boot_start} ${boot_size}
> 
> Now suppose that we have changed the partition table and boot_part now
> is 10. We will need to fix commands above. And anyone who relies on
> these boot commands, will need to change them accordingly, too (this was
> an actual case in our lab while testing Linux boot on Android
> environment).
> 
> By providing the option to pass partition name instead, we fix mentioned
> issue, by eliminating the necessity to use magic numbers.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> Reviewed-by: Lukasz Majewski <lukma at denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180314/8fa6c325/attachment.sig>


More information about the U-Boot mailing list