diff options
author | Silas Jeon <silas.jeon@samsung.com> | 2017-02-16 15:35:11 +0900 |
---|---|---|
committer | Silas Jeon <silas.jeon@samsung.com> | 2017-02-20 17:23:17 +0900 |
commit | 04f389b40fee5e6fcb578c16119bc1d51fc00973 (patch) | |
tree | a6a9397c9205d4de6623b9cb1b35e0f84430093a | |
parent | 97b6c51f896e3097ad6bb137df101803c93da2d5 (diff) | |
download | system-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.tar.gz system-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.tar.bz2 system-plugin-04f389b40fee5e6fcb578c16119bc1d51fc00973.zip |
Init wrapper : fixed some issuessubmit/tizen/20170220.092042accepted/tizen/wearable/20170220.223141accepted/tizen/tv/20170220.223124accepted/tizen/mobile/20170220.223105accepted/tizen/ivi/20170220.223155accepted/tizen/common/20170220.144418
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.wrapper | 29 |
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 |