Commit d7afbdf6 authored by Nico's avatar Nico
Browse files

Use Tor binary for armhf (armv7)

Example devices are Nexus 5 and Raspberry Pi v2.

Based on !1376

Related to #1854
parent b738bdd1
......@@ -25,6 +25,7 @@ import javax.annotation.concurrent.Immutable;
import javax.inject.Inject;
import javax.net.SocketFactory;
import static java.util.logging.Level.INFO;
import static java.util.logging.Logger.getLogger;
import static org.briarproject.bramble.util.OsUtils.isLinux;
......@@ -96,12 +97,15 @@ public class UnixTorPluginFactory implements DuplexPluginFactory {
String architecture = null;
if (isLinux()) {
String arch = System.getProperty("os.arch");
LOG.info("System's os.arch is " + arch);
if (LOG.isLoggable(INFO)) {
LOG.info("System's os.arch is " + arch);
}
if (arch.equals("amd64")) {
architecture = "linux-x86_64";
}
else if (arch.equals("aarch64")) {
} else if (arch.equals("aarch64")) {
architecture = "linux-aarch64";
} else if (arch.equals("arm")) {
architecture = "linux-armhf";
}
}
if (architecture == null) {
......@@ -109,7 +113,9 @@ public class UnixTorPluginFactory implements DuplexPluginFactory {
return null;
}
LOG.info("The selected architecture for Tor is " + architecture);
if (LOG.isLoggable(INFO)) {
LOG.info("The selected architecture for Tor is " + architecture);
}
Backoff backoff = backoffFactory.createBackoff(MIN_POLLING_INTERVAL,
MAX_POLLING_INTERVAL, BACKOFF_BASE);
......
......@@ -15,6 +15,7 @@ To build the `jar` file, you need to specify the combination of architecture and
$ ./gradlew --configure-on-demand briar-headless:x86LinuxJar
$ ./gradlew --configure-on-demand briar-headless:aarch64LinuxJar
$ ./gradlew --configure-on-demand briar-headless:armhfLinuxJar
You can start the peer (and its API server) like this:
......
......@@ -58,7 +58,7 @@ void jarFactory(Jar jarTask, jarArchitecture) {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
{
String[] architectures = ["linux-aarch64", "linux-x86_64"]
String[] architectures = ["linux-aarch64", "linux-armhf", "linux-x86_64"]
for (String arch : architectures) {
if (arch != jarArchitecture) {
exclude "obfs4proxy_" + arch + ".zip"
......@@ -102,6 +102,10 @@ task aarch64LinuxJar(type: Jar) {
jarFactory(it, 'linux-aarch64')
}
task armhfLinuxJar(type: Jar) {
jarFactory(it, 'linux-armhf')
}
task x86LinuxJar(type: Jar) {
jarFactory(it, 'linux-x86_64')
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment