Files
Tobias WaldekranzandJoachim Wiberg 246b06b8d5 uboot: When booting from a block device, wait for it to show up
The kernel's mounting of the rootfs may race against the underlying
device being probed - especially for media like MMC cards and USB
sticks.

Therefore, tell the kernel to wait for the root device to show up.
2023-08-25 10:51:45 +02:00

19 lines
587 B
Bash

if load ${devtype} ${devnum}:${auxpart} ${ramdisk_addr_r} /${slot}.itbh; then
setenv old_fdt_addr ${fdt_addr}
if fdt addr ${ramdisk_addr_r}; then
fdt get value sqoffs /images/rootfs data-position
fdt get value sqsize /images/rootfs data-size
fdt addr ${old_fdt_addr}
setexpr sqaddr ${ramdisk_addr_r} + ${sqoffs}
setexpr sqblkcnt ${sqsize} / 0x200
if part start ${devtype} ${devnum} ${slot} devoffs; then
if ${devtype} read ${sqaddr} ${devoffs} ${sqblkcnt}; then
setenv bootargs_root "root=PARTLABEL=${slot} rootwait"
setenv prepared ok
fi
fi
fi
fi