PiFrameFleet/arch_detect.sh

21 lines
514 B
Bash
Raw Normal View History

2020-08-06 22:22:05 +00:00
#!/bin/sh
python3 <<EOF
from __future__ import print_function
import platform
processor = platform.machine()
architecture = platform.architecture()
if processor == 'aarch64':
# Mutli arch arm support is why this 32bit check is present
if '32bit' in architecture:
print('arm', end='')
else:
print('aarch64', end='')
elif processor == 'x86 64' or processor == 'x86_64':
print('amd64', end='')
elif processor == 'armv7l':
print('arm', end='')
else:
print('armhf', end='')
EOF