[PATCH for next 08/15] ARM: phytec-som-imx6: add boot device emmc and automount

Trent Piepho tpiepho at kymetacorp.com
Thu Apr 28 13:31:42 PDT 2016


I added an ability to barebox to put partition GUIDs into MMC device
attributes.  Then I can start the kernel by passing the GUID for the
rootfs, which the kernel code (not initramfs+udev, the kernel itself)
can parse and mount.

Like:
global.linux.bootargs.dyn.root="root=PARTUUID=${mmc0.root0} rw rootwait"

I only have mmc0 to worry about (with multiple roots that barebox
determines which to use), but I think this would allow you to say
PARTUUID=${mmc0.root} vs PARTUUID=${mmc1.root} in barebox and have the
kernel find the correct partition without needing to worry about what
mmcblkXpY device it happens to be assigned to by the kernel.


On Thu, 2016-04-28 at 13:56 +0200, Holger Schurig wrote:
> > Does this work reliably? Is there finally a patch upstream that creates
> > fixed numbers for MMC/SD block devices?
> 
> I have a *hack* that in my kernel that names the SD-Card to "sdblk0" and
> my eMMC to "mmcblk0". That that is completely unacceptable for upstream,
> I never even tried it. :-)
> 
> 
> Index: linux-4.3/drivers/mmc/card/block.c
> ===================================================================
> --- linux-4.3.orig/drivers/mmc/card/block.c	2015-12-09 17:17:57.264650273 +0100
> +++ linux-4.3/drivers/mmc/card/block.c	2015-12-10 08:46:41.874985403 +0100
> @@ -2259,14 +2259,16 @@ static struct mmc_blk_data *mmc_blk_allo
>  	 * messages to tell when the card is present.
>  	 */
>  
> -	snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
> -		 "mmcblk%u%s", md->name_idx, subname ? subname : "");
> -
> -	if (mmc_card_mmc(card))
> +	if (mmc_card_mmc(card)) {
> +		snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
> +			 "mmcblk0%s", subname ? subname : "");
>  		blk_queue_logical_block_size(md->queue.queue,
>  					     card->ext_csd.data_sector_size);
> -	else
> +	} else {
> +		snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
> +			 "sdblk0%s", subname ? subname : "");
>  		blk_queue_logical_block_size(md->queue.queue, 512);
> +	}
>  
>  	set_capacity(md->disk, size);
>  
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list