Retry finding partitions if no rootfs has been found to let kernel to
probe slowly-initializing block devices.
Change-Id: I8eeb72d1e44c4e91609ea21d3185a616082ce913
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
/usr/bin/xargs
/usr/bin/mkdir
/usr/bin/mount
+/usr/bin/sleep
/usr/bin/umount
/usr/sbin/blkid
/usr/sbin/pivot_root
IN_INITRAMFS=0
NEED_RESIZEFS=1
USERFS_ENCRYPTED=0
+FS_RETRY_COUNT=10
BLKID_LINES=()
IFS_BACKUP=$IFS
IFS=$'\n'
- if [ "x$BLKID_LINES" = "x" ]; then
- BLKID_LINES=($(/sbin/blkid))
- fi
+ BLKID_LINES=($(/sbin/blkid))
SUPERFS=`get_blk_dev_path "PARTLABEL=\"super\""`
if [ x$SUPERFS = "x" ]
IFS=$IFS_BACKUP
}
+function wait_find_partitions()
+{
+ for ((I=1;I<=$FS_RETRY_COUNT;I++))
+ do
+ find_partitions
+ if [ x$ROOTFS != "x" ]
+ then
+ break
+ fi
+ echo "Waiting for rootfs block device, try $I of $FS_RETRY_COUNT..."
+ sleep .5
+ done
+}
+
function check_flags()
{
if [ -e /etc/initrd-release ]
check_network
setup_nbd
-find_partitions
+wait_find_partitions
check_flags
process_rootfs