Fix race condition 72/201372/1
authorINSUN PYO <insun.pyo@samsung.com>
Wed, 13 Mar 2019 06:05:18 +0000 (15:05 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Wed, 13 Mar 2019 06:05:18 +0000 (15:05 +0900)
Power is turned off as soon as /opt/var/.resizefs_done is written.
Rootfs, userfs and module partition does not execute resizefs foreever.

Change-Id: I5eb2ebb3135443ff21cbbaf4944f0a759940e76a

scripts/init.sh

index 5aa6840..7b884de 100755 (executable)
@@ -47,7 +47,6 @@ then
     then
         NEED_RESIZEFS=0
     else
-        echo " " > /opt/var/.resizefs_done
         /bin/umount /opt
     fi
 fi
@@ -106,6 +105,11 @@ then
     /bin/mount $MODULES /sysroot/usr/lib/modules
 fi
 
+if [ x"$DATAFS" != "x" -a "$NEED_RESIZEFS" = "1" ]
+then
+    echo " " > /sysroot/opt/var/.resizefs_done
+fi
+
 cd /sysroot
 mkdir -p ./dev ./sys ./proc ./initrd
 /sbin/pivot_root . ./initrd