From: Dongwoo Lee Date: Tue, 19 Feb 2019 06:55:53 +0000 (+0900) Subject: Check failure of network configuration X-Git-Tag: submit/tizen/20190222.054942^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8774549b0bc8dc814c5284d79fcf65aaba012e77;p=platform%2Fcore%2Fsystem%2Finitrd-flash.git Check failure of network configuration If network configuration is failed due to some reason, tfm cannot be proceeded. In this case, reboot the system to retry when network setup fails. Change-Id: Idb615fb455ea2af9226c5caf395e1a06bb94e954 Signed-off-by: Dongwoo Lee --- diff --git a/scripts/flash-init.sh b/scripts/flash-init.sh index dd345d5..34ead7d 100755 --- a/scripts/flash-init.sh +++ b/scripts/flash-init.sh @@ -30,10 +30,16 @@ clear_bootmode() { print_ip() { IPADDR=`"$IP" -4 addr show $NETIF | "$GREP" -oP '(?<=inet\s)\d+(\.\d+){3}'` if [ "z$IPADDR" == "z" ]; then - echo "IP address is not set, using default (192.168.0.100)" IPADDR="192.168.0.100" - "$IFCONFIG" $NETIF $IPADDR up + RESULT=`"$IFCONFIG" $NETIF $IPADDR up` + + if [ "z$RESULT" != "z" ]; then + echo "Failed to set IP address, Reboot..." + "$REBOOT" + fi + + echo "IP address is not set, using default (192.168.0.100)" fi echo "IP address is set to ${IPADDR}" } @@ -54,6 +60,6 @@ do_flash() { #------------------------------------------------ # Main Routine Start #------------------------------------------------ -clear_bootmode print_ip +clear_bootmode do_flash