Am 27.03.2017 um 18:32 schrieb Tony Lindgren tony@atomide.com:
- Matthijs van Duin matthijsvanduin@gmail.com [170327 09:19]:
On 27 March 2017 at 18:07, Tony Lindgren tony@atomide.com wrote:
Anyways, that still won't help end users are all, this only helps the people who have the TRM fnord instance numbering burnt into their brains :)
It's a numbering consistent across boot, and consistent with u-boot's device numbering, which means the boot script can first load a kernel from mmc $n partition $p and then pass root=/dev/mmcblk${n}p${p} to the kernel.
And that's where people will say "use UUIDs" as the Linux generic solution. Won't help at all making sense of dmesg output though.
For me it works with uuid. I have already patched our default u-boot environment a while ago so that it works. At least that you get the same device for rootfs as where u-boot did come from. The same on AM3358 and all OMAPs.
It is a big and ugly hack in U-Boot which assumes to use hard coded partition 2 but works for me reasonably well (meaning: it certainly can be improved but I did not have a reason yet)...
http://git.goldelico.com/?p=gta04-uboot.git;a=blob;f=include/configs/ti_armv...
62 "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \ 63 "args_mmc=run finduuid;setenv bootargs console=${console} " \ 64 "${optargs} " \ 65 "root=PARTUUID=${uuid} rw " \ 66 "rootfstype=${mmcrootfstype}\0" \
Now this does not solve the problem that Linux might have a randomized sequence of assigning mmcblk0 and mmcblk1 when being accessed from user-space.
So if we want to e.g. write a script to (re)flash eMMC when booted from SD we might have to scan the mount table to find out which drive is the root and reject to overwrite with bad eMMC contents...
See the slot_name solution I just replied with.
I don't see how that is helpful at all. If I just wanted some DT-specified label I can slap some property onto the DT nodes and access it via the of_node symlink. This is e.g. what I do for uio devices on beaglebones:
SUBSYSTEM=="uio", SYMLINK+="uio/%s{device/of_node/uio-alias}"
Sure.
So I guess no still no Linux generic solution in sight.
Regards,
Tony