From 445d8519e3810ce96ec4d21dfc53d9fbdaaa2b68 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Wed, 18 May 2016 00:05:26 +0800 Subject: [PATCH] nativebridge: download and mount sfs --- init.x86.rc | 1 + nativebridge/bin/enable_nativebridge | 21 ++++----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/init.x86.rc b/init.x86.rc index c9671b1..5814e86 100644 --- a/init.x86.rc +++ b/init.x86.rc @@ -138,6 +138,7 @@ on property:debug.logcat=1 class_start debug on property:persist.sys.nativebridge=1 + mkdir /data/arm 0775 system system start nativebridge on property:persist.sys.nativebridge=0 diff --git a/nativebridge/bin/enable_nativebridge b/nativebridge/bin/enable_nativebridge index 3de5cfb..1e8289c 100644 --- a/nativebridge/bin/enable_nativebridge +++ b/nativebridge/bin/enable_nativebridge @@ -6,20 +6,8 @@ houdini_bin=0 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 @@ -28,9 +16,8 @@ while [ ! -s $dest_dir/libhoudini.so ]; do 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 -- 2.11.0