OSDN Git Service

nativebridge: download and mount sfs
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 17 May 2016 16:05:26 +0000 (00:05 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 22 May 2016 10:20:12 +0000 (18:20 +0800)
init.x86.rc
nativebridge/bin/enable_nativebridge

index c9671b1..5814e86 100644 (file)
@@ -138,6 +138,7 @@ on property:debug.logcat=1
     class_start debug
 
 on property:persist.sys.nativebridge=1
     class_start debug
 
 on property:persist.sys.nativebridge=1
+    mkdir /data/arm 0775 system system
     start nativebridge
 
 on property:persist.sys.nativebridge=0
     start nativebridge
 
 on property:persist.sys.nativebridge=0
index 3de5cfb..1e8289c 100644 (file)
@@ -6,20 +6,8 @@ houdini_bin=0
 dest_dir=/system/lib$1/arm$1
 binfmt_misc_dir=/proc/sys/fs/binfmt_misc
 
 dest_dir=/system/lib$1/arm$1
 binfmt_misc_dir=/proc/sys/fs/binfmt_misc
 
-cd $dest_dir
-
-if [ ! -s libhoudini.so ]; then
-       if touch .dl_houdini; then
-               rm -f .dl_houdini
-       else
-               cd .. && cp -a arm$1 /data/local/tmp
-               mount -t tmpfs tmpfs arm$1 && cd arm$1 &&
-                       cp -a /data/local/tmp/arm$1/* . && rm -rf /data/local/tmp/arm$1
-       fi
-fi
-
-cd /data/local/tmp
-while [ ! -s $dest_dir/libhoudini.so ]; do
+cd /data/arm
+while ! busybox mount houdini$1.sfs $dest_dir; do
        while [ "$(getprop net.dns1)" = "" ]; do
                sleep 10
        done
        while [ "$(getprop net.dns1)" = "" ]; do
                sleep 10
        done
@@ -28,9 +16,8 @@ while [ ! -s $dest_dir/libhoudini.so ]; do
        else
                url=http://goo.gl/n6KtQa
        fi
        else
                url=http://goo.gl/n6KtQa
        fi
-       wget $url -cO houdini.tgz &&
-               bzcat houdini.tgz | tar xvf - -C $dest_dir && rm -f houdini.tgz && break
-       rm -f houdini.tgz
+       wget $url -cO houdini$1.sfs && continue
+       rm -f houdini$1.sfs
        sleep 30
 done
 
        sleep 30
 done