From 8003c018dbc4e6d6c8c46a321fdb5de25ff3daff Mon Sep 17 00:00:00 2001 From: Jianlong Huang Date: Tue, 30 Aug 2022 08:40:56 +0800 Subject: [PATCH] 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 --- system/skeleton/init | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/system/skeleton/init b/system/skeleton/init index 7586499a..aa9c23a0 100755 --- a/system/skeleton/init +++ b/system/skeleton/init @@ -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