[Miscellaneous Android Development] 888jonathan:
Latest twu2 R/W fix

The followings were quoted from twu2's mobile01.com/topicdetail.php?f=605&t=3470158&p=1(Chinese website)

A file made by him, already packed with everything you need multiupload.nl/9XZ7BJ6ZH0

========================================

These are the changes(the translations may not be accurate!!!)

1.由於 busybox 是依據 softlink 的名稱來決定要執行什麼功能, 所以, 我們仍需要一個指到 /system/xbin/busybox 的 mount 指令, 但又不能用 /system/bin/mount 或 /system/xbin/mount, 所以... 就建一個目錄 /system/xbin/.mount_wrapper/ , 然後在裡頭做一個叫 mount 的 softlink 指到 /system/xbin/busybox, 如:

==>Translations:

Softlink decides the functions of busybox. In that case, we need a mount command point to /system/xbin/busybox. But, we can't use /system/bin/mount or /system/xbin/mount. So, make a folder /system/xbin/.mount_wrapper/, and make a softlink point to /system/xbin/busybox, as the followings.

==========================================================

shell@android:/system/xbin/.mount_wrapper # ls -la

ls -la

lrwxrwxrwx root root 2013-07-30 10:09 mount -> ../busybox

==========================================================

2.把 /system/bin/wrapper.sh 改成這個樣子:

#!/system/bin/sh

==>Translations:

Rewrite /system/bin/wrapper.sh

==========================================================

CMD=`basename $0`

ARG="$*"

NEWARG="-o remount,rw /system /system/"

LArg=$(eval echo \$$#)

case "$CMD" in

"busybox")

if [ $1 == "mount" ] && [ $2 == "-o" ] && ([ $3 == "rw,remount" ] || [ $3 == "remount,rw" ]); then

if [ $LArg == "/system" ] || [ $LArg == "/system/" ]; then

/system/xbin/.mount_wrapper/mount $NEWARG

# return $?

return 0

fi

fi

/system/xbin/busybox $ARG

# return $?

return 0

;;

"mount")

if [ $1 == "-o" ] && ([ $2 == "rw,remount" ] || [ $2 == "remount,rw" ]); then

if [ $LArg == "/system" ] || [ $LArg == "/system/" ]; then

/system/xbin/.mount_wrapper/mount $NEWARG

# return $?

return 0

fi

fi

/system/bin/toolbox mount $ARG

# return $?

return 0

;;

esac

exit 0

===============================================================

3.然後把 /system/bin/busybox, /system/bin/mount, /system/xbin/mount 都用 softlink 的方式指到 /system/bin/wrapper.sh, 如:

==>Translations:

And then point /system/bin/busybox, /system/bin/mount, /system/xbin/mount to /system/bin/wrapper.sh with softlink.

===============================================================

shell@android:/system/xbin # ls -la mount

ls -la mount

lrwxrwxrwx root root 2013-07-30 10:09 mount -> ../bin/wrapper.sh

shell@android:/system/xbin # cd ../bin

cd ../bin

shell@android:/system/bin # ls -la mount

ls -la mount

lrwxrwxrwx root root 2013-07-30 10:01 mount -> wrapper.sh

shell@android:/system/bin # ls -la busybox

ls -la busybox

lrwxrwxrwx root root 2013-07-30 10:01 busybox -> wrapper.sh

===============================================================

經過這樣子的處理之後, 不管是執行 /system/bin/mount 或 /system/xbin/mount (通常都是用這兩個吧) 或 /system/bin/busybox 來做 remount /system 的動作, 都可以正常執行. 我試過沒改過的 OTA RootKeeper 或 ES File Explorer 都可以正常運作.

==>Translations:

After the changes, no matter running /system/bin/mount , /system/xbin/mount or /system/bin/busybox to remount /system, it will work. And the official OTA RootKeeper or ES File Explorer will also run properly.

fREAST0, you should use this, I think the method you use was an early one.(This method was already posted here xdaforums.com/showthread.php?p=44091665&highlight=twu2#post44091665)