41 lines
1.6 KiB
Bash
41 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
if dpkg -l box64 &>/dev/null ;then
|
|
sudo apt purge -y --allow-change-held-packages box64*
|
|
fi
|
|
|
|
sudo wget https://pi-apps-coders.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
|
|
if [ $? != 0 ];then
|
|
sudo rm -f /etc/apt/sources.list.d/box64.list
|
|
error "Failed to add box64.list file!"
|
|
fi
|
|
|
|
sudo rm -f /usr/share/keyrings/box64-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
|
|
sudo mkdir -p /etc/apt/trusted.gpg.d
|
|
wget -qO- https://pi-apps-coders.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg > /dev/null
|
|
|
|
if [ $? != 0 ];then
|
|
sudo rm -f /etc/apt/sources.list.d/box64.list
|
|
error "Failed to add KEY.gpg to APT keyring!"
|
|
fi
|
|
|
|
# obtain SOC_ID
|
|
get_model
|
|
if [[ "$SOC_ID" == "tegra-x1" ]] || [[ "$SOC_ID" == "tegra-x2" ]]; then
|
|
install_packages box64-tegrax1 || exit 1
|
|
elif [[ "$SOC_ID" == "rk3399" ]]; then
|
|
install_packages box64-rk3399 || exit 1
|
|
elif [[ "$SOC_ID" == "bcm2711" ]]; then
|
|
install_packages box64-rpi4arm64 || exit 1
|
|
elif [[ "$SOC_ID" == "bcm2837" ]]; then
|
|
install_packages box64-rpi3arm64 || exit 1
|
|
elif cat /proc/cpuinfo | grep -q aes; then
|
|
warning "There is no box64 pre-build for your device $SOC_ID $model"
|
|
warning "Installing the generic arm box64 build as a fallback (crypto extensions enabled)"
|
|
install_packages box64-generic-arm || exit 1
|
|
else
|
|
warning "There is no box64 pre-build for your device $SOC_ID $model"
|
|
warning "Installing the RPI4 tuned box64 build as a fallback (no crypto extensions enabled)"
|
|
install_packages box64-rpi4arm64 || exit 1
|
|
fi
|