Bug fix: change the location of rootfs(/sysroot) read-only mount 53/169753/2 accepted/tizen/unified/20180209.064042 submit/tizen/20180209.022053
authorHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 9 Feb 2018 02:07:59 +0000 (11:07 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 9 Feb 2018 02:14:51 +0000 (11:14 +0900)
Change-Id: Ica45471e6801ceca95d14a0be1a6d1dc75712814
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
scripts/init.sh

index a246393e494e387bae64e59baa8a523d0ea5387c..4a8f0649564bd8575c0feb15bd086a362632b6a5 100755 (executable)
@@ -48,7 +48,7 @@ then
         /sbin/resize2fs -f $ROOTFS
         /sbin/fsck -y $ROOTFS
     fi
-    /bin/mount $ROOTFS /sysroot -o ro
+    /bin/mount $ROOTFS /sysroot -o rw
 else
     echo "WARNING : THERE IS NO ROOTFS."
     exec /bin/sh
@@ -86,21 +86,19 @@ then
     /bin/mount $MODULES /sysroot/usr/lib/modules
 fi
 
-
 cd /sysroot
 mkdir -p ./initrd
-
 /sbin/pivot_root . ./initrd
 /bin/mount -M ./initrd/dev /dev
 /bin/mount -M ./initrd/sys /sys
 /bin/mount -M ./initrd/proc /proc
 /bin/umount -l ./initrd
-/bin/rm -r ./initrd
+/bin/rm -rf ./initrd
+/bin/mount -o remount,ro .
 
 INIT=/sbin/init
-
 if [ $$ = 1 ]
 then
-  exec chroot . $INIT $@
+    exec chroot . $INIT $@
 fi
 exec /bin/sh