summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilas Jeon <silas.jeon@samsung.com>2017-02-16 15:35:11 +0900
committerSilas Jeon <silas.jeon@samsung.com>2017-02-20 17:23:17 +0900
commit04f389b40fee5e6fcb578c16119bc1d51fc00973 (patch)
treea6a9397c9205d4de6623b9cb1b35e0f84430093a
parent97b6c51f896e3097ad6bb137df101803c93da2d5 (diff)
downloadsystem-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.tar.gz
system-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.tar.bz2
system-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.zip
Made rootfs as RW after fsck, to make fsck work properly. Added fsck command for system-data partition before mounting. Fixed DATAFS to $DATAFS. It was misspelled. Added some comments. Change-Id: Id5efd195230815b8826fa81f59dff58a4d3c7d23
-rw-r--r--scripts/init.wrapper29
1 files changed, 13 insertions, 16 deletions
diff --git a/scripts/init.wrapper b/scripts/init.wrapper
index 1ee8917..56aef97 100644
--- a/scripts/init.wrapper
+++ b/scripts/init.wrapper
@@ -9,35 +9,31 @@ mount -o nosuid,strictatime,mode=755 -t devtmpfs devtmpfs /dev
mount -o nosuid,noexec,nodev -t sysfs sysfs /sys
mount -o nosuid,noexec,nodev -t proc proc /proc
+#Find devices with label or partlabel
ROOTFS=`/sbin/blkid -L rootfs`
if [ x$ROOTFS = "x" ]
then
-ROOTFS=`/sbin/blkid -t PARTLABEL=rootfs -o device`
+ ROOTFS=`/sbin/blkid -t PARTLABEL=rootfs -o device`
fi
DATAFS=`/sbin/blkid -L system-data`
if [ x$DATAFS = "x" ]
then
-DATAFS=`/sbin/blkid -t PARTLABEL=system-data -o device`
+ DATAFS=`/sbin/blkid -t PARTLABEL=system-data -o device`
fi
-if [ "$ROOTFS" == "" ]
+#Fsck, resize, mount devices
+if [ x$ROOTFS = "x" ]
then
echo "Warning : There is no rootfs partition."
else
- /usr/bin/mount | grep "$ROOTFS " > /dev/null
-
- if [ $? = "0" ]
- then
- /usr/bin/mount -o remount,rw $ROOTFS
- fi
-
- /sbin/fsck $ROOTFS
+ /sbin/fsck -y $ROOTFS
+ /usr/bin/mount -o remount,rw $ROOTFS
/sbin/resize2fs -f $ROOTFS
+ /usr/bin/mount -o remount,ro $ROOTFS
fi
-
-if [ "$DATAFS" == "" ]
+if [ x$DATAFS = "x" ]
then
echo "Warning : There is no system-data partition."
else
@@ -45,9 +41,10 @@ else
if [ $? = "0" ]
then
- /usr/bin/umount -l "DATAFS"
+ /usr/bin/umount -l "$DATAFS"
fi
-
+ /sbin/fsck -y $DATAFS
+ /sbin/resize2fs -f $DATAFS
/usr/bin/mount $DATAFS $SYSTEM_MNT
fi
@@ -58,6 +55,6 @@ fi
echo "======================================================================"
echo "[/sbin/init] WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-echo "This Message should be never printed. ($INIT execution failure?)"
+echo "This Message should never be printed. ($INIT execution failure?)"
echo "======================================================================"
exec /bin/sh