summaryrefslogtreecommitdiff
path: root/standalone/android/runshell
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-24 13:25:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-24 13:27:06 -0400
commit2b2b7c56397fd5457bd178e9243d392afd2b07f0 (patch)
tree76693e311929a94504974b61836dd5c81ec3d69f /standalone/android/runshell
parent0ef3771e174671ebb9074c96c52063c5db6789b2 (diff)
use C shim to start Android app
This should avoid relying on features of the Android builtin shell, and so hopefully avoid failures like this one http://git-annex.branchable.com/design/assistant/blog/day_197__template_haskell/#comment-07f90830f78f6495dcbdf90eb8636129 The C shim sets up busybox, and uses its builtin shell to run runshell. It's important that busybox be configured with CONFIG_FEATURE_SH_STANDALONE, so that while runshell is running, it does not rely on either system utilities, or busybox being already installed.
Diffstat (limited to 'standalone/android/runshell')
-rwxr-xr-xstandalone/android/runshell9
1 files changed, 3 insertions, 6 deletions
diff --git a/standalone/android/runshell b/standalone/android/runshell
index e21e6bfe0..438857e9a 100755
--- a/standalone/android/runshell
+++ b/standalone/android/runshell
@@ -1,13 +1,10 @@
#!/system/bin/sh
-# This is run by the Android app, and runs a shell in an environment
-# configured for git-annex.
+# This is runs a shell in an environment configured for git-annex.
set -e
prep () {
- # I'm installed as lib/lib.runshell.so
- orig="$(pwd)"
- cd "$0/../.."
+ # lib.start.so will run us in the root of our app directory
base="$(pwd)"
# Cannot rely on Android providing a sane HOME
@@ -57,7 +54,7 @@ buildtree () {
}
install () {
- if [ ! -d "$base/bin" ]; then
+ if [ ! -e "$base/git-annex" ]; then
if ! mkdir -p "$HOME"; then
echo "mkdir of $HOME failed!"
fi