add linux arm support: RaspberryPi(armv7l) and aarch64

This commit is contained in:
j 2016-06-24 12:51:01 +02:00
parent abc0b82961
commit 4c34cbed3c
4 changed files with 22 additions and 3 deletions

7
ctl
View File

@ -44,6 +44,13 @@ else
else else
ARCH=32 ARCH=32
fi fi
if [ $PLATFORM == "aarch64" ]; then
ARCH="_aarch64"
PLATFORM_PY=3.5
fi
if [ $PLATFORM == "armv7l" ]; then
ARCH="_armv7l"
fi
PLATFORM="linux$ARCH" PLATFORM="linux$ARCH"
fi fi
if [ $SYSTEM == "Darwin" ]; then if [ $SYSTEM == "Darwin" ]; then

View File

@ -20,7 +20,12 @@ def get_platform():
name = 'darwin64' name = 'darwin64'
elif name.startswith('linux'): elif name.startswith('linux'):
import platform import platform
if platform.architecture()[0] == '64bit': machine = platform.machine()
if machine == 'armv7l':
name = 'linux_armv7l'
elif machine == 'aarch64':
name = 'linux_aarch64'
elif machine == 'x86_64':
name = 'linux64' name = 'linux64'
else: else:
name = 'linux32' name = 'linux32'

View File

@ -56,7 +56,7 @@ DirReqStatistics 0
with open(torrc, 'r') as fd: with open(torrc, 'r') as fd:
data = fd.read() data = fd.read()
modified_data = re.sub('DataDirectory.*?TorData', modified_data = re.sub('DataDirectory.*?TorData',
'DataDirectory {tor_data}'.format(tor_data=tor_data), data) 'DataDirectory {tor_data}'.format(tor_data=tor_data), data)
if data != modified_data: if data != modified_data:
with open(torrc, 'w') as fd: with open(torrc, 'w') as fd:
fd.write(modified_data) fd.write(modified_data)
@ -298,6 +298,8 @@ def get_tor():
for path in ( for path in (
os.path.join(settings.base_dir, '..', 'platform_linux64', 'tor', 'tor'), os.path.join(settings.base_dir, '..', 'platform_linux64', 'tor', 'tor'),
os.path.join(settings.base_dir, '..', 'platform_linux32', 'tor', 'tor'), os.path.join(settings.base_dir, '..', 'platform_linux32', 'tor', 'tor'),
os.path.join(settings.base_dir, '..', 'platform_linux_armv7l', 'tor', 'tor'),
os.path.join(settings.base_dir, '..', 'platform_linux_aarch64', 'tor', 'tor'),
): ):
if os.path.isfile(path) and os.access(path, os.X_OK): if os.path.isfile(path) and os.access(path, os.X_OK):
return os.path.normpath(path) return os.path.normpath(path)

View File

@ -113,7 +113,12 @@ def get_platform():
name = 'darwin64' name = 'darwin64'
elif name.startswith('linux'): elif name.startswith('linux'):
import platform import platform
if platform.architecture()[0] == '64bit': machine = platform.machine()
if machine == 'armv7l':
name = 'linux_armv7l'
elif machine == 'aarch64':
name = 'linux_aarch64'
elif machine == 'x86_64':
name = 'linux64' name = 'linux64'
else: else:
name = 'linux32' name = 'linux32'