[Letux-kernel] Subtle issue with U-Boot and kernel and SD card UUIDs

Belisko Marek marek.belisko at gmail.com
Tue May 23 11:25:37 CEST 2017


Hi Nikoalus,

On Tue, May 23, 2017 at 10:42 AM, H. Nikolaus Schaller
<hns at goldelico.com> wrote:
> Hi,
> I recently flashed the eMMC of the OMAP5EVM and the Pyra and now a subtle issue
> has surfaced.
>
> If I boot without SD card from eMMC everything is fine.
>
> But if I boot from the SD card it works fine for U-Boot and loading the kernel,
> but the kernel loaded from SD card mounts the rootfs from eMMC and does not find
> any loadable modules (unless kernels are exactly the same version).
>
> I could trace the u-boot-kernel interaction down to the uboot environment
>
>         finduuid=part uuid mmc ${mmcdev}:2 uuid
>         args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
I was facing similar issue yesterday but my root looks like
root=LABEL=rootfsA. I just drop LABEL=rootfsA and replace by /dev/sdb2
(in my case) and it works fine.
I was trying shortly look to kernel source and I cannot find anything
related to LABEL but for your case it should work (please loon for
comment for function name_to_dev_t in ini/do_mounts.c)
Hope this helps.
>
> This is not at all wrong and should do what it is intended for: map the mmc
> device numbers from U-Boot in a way that the kernel can assign a different
> order (and it does!).
>
> This is done by translating the device numbers into a unique code, i.e. the
> UUID.
>
> Now why does it not work in my setup?
>
> Breaking into the U-Boot console shows the problem:
>
> => part list mmc 0
>
> Partition Map for MMC device 0  --   Partition Type: DOS
>
> Part    Start Sector    Num Sectors     UUID            Type
>   1     128             778233          00000000-01     0c Boot
>   2     778361          14786439        00000000-02     83
> => part list mmc 1
>
> Partition Map for MMC device 1  --   Partition Type: DOS
>
> Part    Start Sector    Num Sectors     UUID            Type
>   1     128             386656          00000000-01     0c Boot
>   2     386784          7346464         00000000-02     83
> =>
>
> Both, the eMMC and the SD card have the same UUIDs i U-Boot and therefore
> the kernel picks up the wrong one...
>
> Now how can they have the same UUID? It should be unique, shouldn't it?
>
> That is strange since after booting into Linux (still without
> kernel modules), I can look up how Linux sees the storage partitions:
>
> root at letux:~# blkid
> /dev/mmcblk0p1: LABEL="boot" UUID="E052-71A6" TYPE="vfat"
> /dev/mmcblk0p2: LABEL="rootfs" UUID="5db8fefe-f8d2-46e4-828a-ab4fe1b8f9b4" TYPE="ext3"
> /dev/mmcblk1p1: LABEL="boot" UUID="ED66-B684" TYPE="vfat"
> /dev/mmcblk1p2: LABEL="rootfs" UUID="cd5f3d4c-c562-4aa0-893c-9fa9e9bd64a9" TYPE="ext3"
> /dev/mmcblk0: PTTYPE="dos"
> /dev/mmcblk1: PTTYPE="dos"
> root at letux:~#
>
> And there, we have nice UUIDs!
>
> Looks as if U-Boot does not recognize them. But the kernel still can mount
> some rootfs by "root=PARTUUID=00000000-02". Strange.
>
> Unfortunately the U-Boot manual is not up to date: https://www.denx.de/wiki/DULG/Manual
>
> Any ideas what puzzle piece we are missing here?
>
> Could be in U-Boot, in Kernel or in formatting the SD/eMMC card.
> CONFIG_PARTITION_UUIDS is enabled in U-Boot (or we would not have the 'part' command).
>
> BR,
> Nikolaus
>
> _______________________________________________
> http://projects.goldelico.com/p/gta04-kernel/
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
> http://lists.goldelico.com/mailman/listinfo.cgi/letux-kernel

BR,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com


More information about the Letux-kernel mailing list