summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-23 13:54:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-23 13:54:49 -0400
commit93e8893cf37080306ec522d389f7e4ecceb84355 (patch)
tree03151b380232a0b41943723b671857b7b9f48d6d
parent90cc410cfbc9f94aeda702b44e49d0169cce75a5 (diff)
Android app: Avoid using hard links to app's lib directory, which is sometimes on a different filesystem than the data directory.
Assumes symlinks work on all android. If not, this would need to be adapted to try both. This worked for me.
-rw-r--r--debian/changelog2
-rw-r--r--standalone/android/Makefile2
-rwxr-xr-xstandalone/android/runshell4
-rw-r--r--standalone/android/start.c12
4 files changed, 13 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog
index f2b1d6758..a7d1aa0fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ git-annex (4.20130522) UNRELEASED; urgency=low
* XMPP: Send pings and use them to detect when contact with the server
is lost.
* hook special remote: Added combined hook program support.
+ * Android app: Avoid using hard links to app's lib directory, which
+ is sometimes on a different filesystem than the data directory.
-- Joey Hess <joeyh@debian.org> Tue, 21 May 2013 18:22:46 -0400
diff --git a/standalone/android/Makefile b/standalone/android/Makefile
index 74a48c89f..85457a719 100644
--- a/standalone/android/Makefile
+++ b/standalone/android/Makefile
@@ -64,7 +64,7 @@ build: start
$(GITTREE)/libexec/git-core/git-web--browse
# Most of git is in one multicall binary, but a few important
# commands are still shell scripts. Those are put into
- # a tarball, along with a list of all the hard links that should be
+ # a tarball, along with a list of all the links that should be
# set up.
cd $(GITTREE) && mkdir -p links
cd $(GITTREE) && find -samefile bin/git -not -wholename ./bin/git > links/git
diff --git a/standalone/android/runshell b/standalone/android/runshell
index 0bd193b74..5e461f062 100755
--- a/standalone/android/runshell
+++ b/standalone/android/runshell
@@ -27,7 +27,7 @@ buildtree () {
if $cmd test -e "$base/bin/$prog"; then
$cmd rm -f "$base/bin/$prog"
fi
- $cmd ln "$base/lib/lib.$prog.so" "$base/bin/$prog"
+ $cmd ln -s "$base/lib/lib.$prog.so" "$base/bin/$prog"
done
$cmd --install $base/bin
@@ -41,7 +41,7 @@ buildtree () {
if $cmd test -e "$base/$link"; then
$cmd rm -f "$base/$link"
fi
- $cmd ln "$base/bin/$prog" "$base/$link"
+ $cmd ln -s "$base/bin/$prog" "$base/$link"
done
$cmd rm -f "$base/links/$prog"
done
diff --git a/standalone/android/start.c b/standalone/android/start.c
index d49a086c7..c67c5da0c 100644
--- a/standalone/android/start.c
+++ b/standalone/android/start.c
@@ -47,11 +47,15 @@ main () {
}
}
- /* If this is the first run, set up busybox link. */
+ /* If this is the first run, set up busybox symlink,
+ * which allows busybox to run. */
if (stat("busybox", &st_buf) != 0) {
- if (link("lib/lib.busybox.so", "busybox") != 0) {
- perror("link busybox");
- exit(1);
+ if (symlink("lib/lib.busybox.so", "busybox") != 0) {
+ /* Just in case! */
+ if (link("lib/lib.busybox.so", "busybox") != 0) {
+ perror("link busybox");
+ exit(1);
+ }
}
}