Add basic logic for Raspi4 ARM64

This commit is contained in:
Taylor Helsper 2021-04-27 21:53:49 -05:00
parent 6cfd572397
commit 46e2e38992
3 changed files with 41 additions and 1 deletions

View File

@ -188,6 +188,9 @@ echo "Upgrading BTC..."
ARCH="UNKNOWN"
if [ $IS_RASPI = 1 ]; then
ARCH="arm-linux-gnueabihf"
if [ $IS_RASPI4_ARM64 = 1 ]; then
ARCH="aarch64-linux-gnu"
fi
elif [ $IS_ROCK64 = 1 ] || [ $IS_ROCKPRO64 = 1 ]; then
ARCH="aarch64-linux-gnu"
elif [ $IS_X86 = 1 ]; then
@ -236,6 +239,9 @@ LND_ARCH="lnd-linux-armv7"
if [ $IS_X86 = 1 ]; then
LND_ARCH="lnd-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LND_ARCH="lnd-linux-arm64"
fi
LND_UPGRADE_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/$LND_ARCH-$LND_VERSION.tar.gz
CURRENT=""
if [ -f $LND_VERSION_FILE ]; then
@ -271,6 +277,9 @@ LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LOOP_ARCH="loop-linux-arm64"
fi
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
CURRENT=""
if [ -f $LOOP_VERSION_FILE ]; then
@ -306,6 +315,9 @@ POOL_ARCH="pool-linux-armv7"
if [ $IS_X86 = 1 ]; then
POOL_ARCH="pool-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
POOL_ARCH="pool-linux-arm64"
fi
POOL_UPGRADE_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/$POOL_ARCH-$POOL_VERSION.tar.gz
CURRENT=""
if [ -f $POOL_VERSION_FILE ]; then
@ -341,6 +353,9 @@ LIT_ARCH="lightning-terminal-linux-armv7"
if [ $IS_X86 = 1 ]; then
LIT_ARCH="lightning-terminal-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LIT_ARCH="lightning-terminal-linux-arm64"
fi
LIT_UPGRADE_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/$LIT_ARCH-$LIT_VERSION.tar.gz
CURRENT=""
if [ -f $LIT_VERSION_FILE ]; then

View File

@ -7,6 +7,7 @@ IS_ROCKPRO64=0
IS_RASPI=0
IS_RASPI3=0
IS_RASPI4=0
IS_RASPI4_ARM64=0
IS_X86=0
DEVICE_TYPE="unknown"
MODEL=$(tr -d '\0' < /proc/device-tree/model) || MODEL="unknown"
@ -23,6 +24,10 @@ elif [[ $MODEL == *"Raspberry Pi 3"* ]]; then
elif [[ $MODEL == *"Raspberry Pi 4"* ]]; then
IS_RASPI=1
IS_RASPI4=1
UNAME=$(uname -a)
if [[ $UNAME == *"aarch64"* ]]; then
IS_RASPI4_ARM64=1
fi
fi
if [ $IS_RASPI3 -eq 1 ]; then

View File

@ -21,6 +21,7 @@ IS_ROCKPRO64=0
IS_RASPI=0
IS_RASPI3=0
IS_RASPI4=0
IS_RASPI4_ARM64=0
IS_X86=0
IS_UNKNOWN=0
DEVICE_TYPE="unknown"
@ -38,6 +39,10 @@ elif [[ $MODEL == *"Raspberry Pi 3"* ]]; then
elif [[ $MODEL == *"Raspberry Pi 4"* ]]; then
IS_RASPI=1
IS_RASPI4=1
UNAME=$(uname -a)
if [[ $UNAME == *"aarch64"* ]]; then
IS_RASPI4_ARM64=1
fi
fi
if [ $IS_UNKNOWN = 1 ]; then
@ -287,6 +292,9 @@ rm -rf /etc/update-motd.d/*
ARCH="UNKNOWN"
if [ $IS_RASPI = 1 ]; then
ARCH="arm-linux-gnueabihf"
if [ $IS_RASPI4_ARM64 = 1 ]; then
ARCH="aarch64-linux-gnu"
fi
elif [ $IS_ROCK64 = 1 ] || [ $IS_ROCKPRO64 = 1 ]; then
ARCH="aarch64-linux-gnu"
elif [ $IS_X86 = 1 ]; then
@ -334,6 +342,9 @@ LND_ARCH="lnd-linux-armv7"
if [ $IS_X86 = 1 ]; then
LND_ARCH="lnd-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LND_ARCH="lnd-linux-arm64"
fi
LND_UPGRADE_URL=https://github.com/lightningnetwork/lnd/releases/download/$LND_VERSION/$LND_ARCH-$LND_VERSION.tar.gz
CURRENT=""
if [ -f $LND_VERSION_FILE ]; then
@ -365,6 +376,9 @@ LOOP_ARCH="loop-linux-armv7"
if [ $IS_X86 = 1 ]; then
LOOP_ARCH="loop-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LOOP_ARCH="loop-linux-arm64"
fi
LOOP_UPGRADE_URL=https://github.com/lightninglabs/loop/releases/download/$LOOP_VERSION/$LOOP_ARCH-$LOOP_VERSION.tar.gz
CURRENT=""
if [ -f $LOOP_VERSION_FILE ]; then
@ -400,6 +414,9 @@ POOL_ARCH="pool-linux-armv7"
if [ $IS_X86 = 1 ]; then
POOL_ARCH="pool-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
POOL_ARCH="pool-linux-arm64"
fi
POOL_UPGRADE_URL=https://github.com/lightninglabs/pool/releases/download/$POOL_VERSION/$POOL_ARCH-$POOL_VERSION.tar.gz
CURRENT=""
if [ -f $POOL_VERSION_FILE ]; then
@ -435,6 +452,9 @@ LIT_ARCH="lightning-terminal-linux-armv7"
if [ $IS_X86 = 1 ]; then
LIT_ARCH="lightning-terminal-linux-amd64"
fi
if [ $IS_RASPI4_ARM64 = 1 ]; then
LIT_ARCH="lightning-terminal-linux-arm64"
fi
LIT_UPGRADE_URL=https://github.com/lightninglabs/lightning-terminal/releases/download/$LIT_VERSION/$LIT_ARCH-$LIT_VERSION.tar.gz
CURRENT=""
if [ -f $LIT_VERSION_FILE ]; then
@ -856,7 +876,7 @@ update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy || true
# Install files (downloaded and extracted earlier)
if [ $IS_X86 = 1 ]; then
if [ $IS_X86 = 1 ] || [ $IS_RASPI4_ARM64 ]; then
rsync -r -K /tmp/upgrade/out/rootfs_*/* /
else
cp -rf /tmp/upgrade/out/rootfs_*/* /