rpot February 2016

How to make correct bootargs for rootfs when device mapping changes

I use the imx.6 sabresd board which can boot using sd-card or emmc. I can boot linux correctly with both of them using u-boot and give the appropriate bootargs with the correct location for the rootfs. But when booting Linux using the eMMC the device name change from /dev/mmcblk1 when the sd card is inserted to /dev/mmcblk0 when the sd card is not inserted.

Now how can I give the correct root= in u-boot using the bootargs parameter when I don't know which device to use?

Of course I can do some tests in u-boot to check if a sd-card is inserted and change the bootargs parameter (just an idea but not yet tested) but actually I was hoping that there was a more elegant solution for this? Any suggestions?

Answers


SergA February 2016

If you kernel and rootfs locates at the same device (sd-card or emmc) you can try to boot in series firstly from sd-card and then from emmc . See idea:

boot_sdcard=setenv bootargs 'root=/dev/mmcblk1 ...'; run load_kernel_sdcard; bootm
boot_emmc=setenv bootargs 'root=/dev/mmcblk0 ...'; run load_kernel_emmc; bootm
bootcmd=run boot_sdcard; run boot_emmc

Kernel wouldn't start if there is no sdcard and u-boot continue boot form emmc.

Post Status

Asked in February 2016
Viewed 3,043 times
Voted 7
Answered 1 times

Search




Leave an answer