The SD card is not ready when ramdisk init and mount root; So add a delay to wait for SD card ready, period is 100ms, timeout is 10s Signed-off-by: Jianlong Huang <jianlong.huang@starfivetech.com>
@@ -40,6 +40,17 @@ if [ $ROOT == "/dev/nfs" ] && [ "x${NFSROOT}" != "x" ];then
/sbin/ifup -a
mount -t nfs -o nolock $NFSROOT /rootfs
else
+ cnt=0
+ while [ $cnt -lt 100 ]
+ do
+ if [ ! -e $ROOT ];then
+ sleep 0.1
+ else
+ echo "find $ROOT: $cnt"
+ break
+ fi
+ let cnt++
+ done
mount $ROOT /rootfs/
if [ ! -e /rootfs/dev/console ]; then
/bin/mknod /rootfs/dev/console c 5 1