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

H. Nikolaus Schaller hns at goldelico.com
Tue May 23 10:42:29 CEST 2017


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}

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



More information about the Letux-kernel mailing list