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:
@@ -40,6 +40,17 @@ if [ $ROOT == "/dev/nfs" ] && [ "x${NFSROOT}" != "x" ];then
|
|||||||
/sbin/ifup -a
|
/sbin/ifup -a
|
||||||
mount -t nfs -o nolock $NFSROOT /rootfs
|
mount -t nfs -o nolock $NFSROOT /rootfs
|
||||||
else
|
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/
|
mount $ROOT /rootfs/
|
||||||
if [ ! -e /rootfs/dev/console ]; then
|
if [ ! -e /rootfs/dev/console ]; then
|
||||||
/bin/mknod /rootfs/dev/console c 5 1
|
/bin/mknod /rootfs/dev/console c 5 1
|
||||||
|
|||||||
Reference in New Issue
Block a user