From: Tom Rini Date: Wed, 24 Jul 2019 16:05:55 -0400 Subject: [U-Boot] [PATCH v5 1/1] cmd: part: Add 'number' sub-command In-Reply-To: <20190614140126.31126-1-igor.opaniuk@gmail.com> References: <20190614140126.31126-1-igor.opaniuk@gmail.com> Message-ID: <20190724200555.GI20116@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Jun 14, 2019 at 05:01:26PM +0300, Igor Opaniuk wrote: > From: Ruslan Trofymenko > > 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: Ruslan Trofymenko > Signed-off-by: Igor Opaniuk > Reviewed-by: Alistair Strachan > Reviewed-by: Sam Protsenko > Reviewed-by: Simon Glass > Reviewed-by: Sam Protsenko 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: