Skip to content

Commit

Permalink
Support for Debian Bullseye and aarch64 (Raspberry Pi OS/Bullseye 64 …
Browse files Browse the repository at this point in the history
…Bit) in setup routines (#1429)

* Remove redundant pip install for bullseye support

pIp is also installed by openaps-packages.sh

* Change python default to python2, install pip, pip install numpy for bullseye support

* Bullseye support on arm64 (Raspberry Pi OS 64bit)

Handle aarch64 architecture properly when downloading golang binaries. 
Without this setup will fail on Rpi 3/4/Zero2 devices where the user has installed the recently-released 64bit OS.

Co-authored-by: Dave Acklam <[email protected]>
  • Loading branch information
dcacklam and Dave Acklam authored Jun 19, 2022
1 parent da7015c commit f35b4ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/openaps-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fi
#dpkg -P nodejs nodejs-dev
# TODO: remove the `-o Acquire::ForceIPv4=true` once Debian's mirrors work reliably over IPv6
apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true -y dist-upgrade && apt-get -o Acquire::ForceIPv4=true -y autoremove
apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true install -y sudo strace tcpdump screen acpid vim python-pip locate ntpdate ntp
apt-get -o Acquire::ForceIPv4=true update && apt-get -o Acquire::ForceIPv4=true install -y sudo strace tcpdump screen acpid vim locate ntpdate ntp
#check if edison user exists before trying to add it to groups

grep "PermitRootLogin yes" /etc/ssh/sshd_config || echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
Expand Down
11 changes: 10 additions & 1 deletion bin/openaps-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4

apt-get install -y sudo
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y git python python-dev software-properties-common python-numpy python-pip watchdog strace tcpdump screen acpid vim locate lm-sensors || die "Couldn't install packages"
## Debian Bullseye (Raspberry Pi OS 64bit, etc) is python3 by default and does not support python2-pip.
if ! cat /etc/os-release | grep bullseye >& /dev/null; then
sudo apt-get install -y git python python-dev software-properties-common python-numpy python-pip watchdog strace tcpdump screen acpid vim locate lm-sensors || die "Couldn't install packages"
else
# Bullseye based OS. Get PIP2 from pypa and pip-install python packages rather than using the py3 ones from apt
# Also, install python-is-python2, to override the distro default of linking python to python3
sudo apt-get install -y git python-is-python2 python-dev-is-python2 software-properties-common watchdog strace tcpdump screen acpid vim locate lm-sensors || die "Couldn't install packages"
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 || die "Couldn't install pip"
python2 -m pip install numpy || die "Couldn't pip install numpy"
fi

# We require jq >= 1.5 for --slurpfile for merging preferences. Debian Jessie ships with 1.4.
if cat /etc/os-release | grep 'PRETTY_NAME="Debian GNU/Linux 8 (jessie)"' &> /dev/null; then
Expand Down
2 changes: 2 additions & 0 deletions bin/oref0-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,8 @@ if prompt_yn "" N; then
echo "Installing Golang..."
if uname -m | grep armv; then
cd /tmp && wget -c https://storage.googleapis.com/golang/go${golangversion}.linux-armv6l.tar.gz && tar -C /usr/local -xzvf /tmp/go${golangversion}.linux-armv6l.tar.gz
elif uname -m | grep aarch64; then
cd /tmp && wget -c https://storage.googleapis.com/golang/go${golangversion}.linux-arm64.tar.gz && tar -C /usr/local -xzvf /tmp/go${golangversion}.linux-arm64.tar.gz
elif uname -m | grep i686; then
cd /tmp && wget -c https://dl.google.com/go/go${golangversion}.linux-386.tar.gz && tar -C /usr/local -xzvf /tmp/go${golangversion}.linux-386.tar.gz
fi
Expand Down

0 comments on commit f35b4ff

Please sign in to comment.