system: skeleton: init: Fix mount ROOT fail

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>
This commit is contained in:
Jianlong Huang
2022-08-30 08:40:56 +08:00
committed by Andy Hu
parent 37130ce9bb
commit 8003c018db
+11
View File
@@ -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