Add Raspberry Pi 5 support

This commit is contained in:
2025-11-12 19:58:03 -05:00
parent bb38515545
commit 6f959e2137

View File

@ -53,7 +53,7 @@ apt-get install -y \
nginx php-fpm php-cli \ nginx php-fpm php-cli \
git build-essential autoconf automake libtool pkg-config \ git build-essential autoconf automake libtool pkg-config \
libjansson-dev libevent-dev libcurl4-openssl-dev libssl-dev zlib1g-dev \ libjansson-dev libevent-dev libcurl4-openssl-dev libssl-dev zlib1g-dev \
openssl openssl jq bc
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# [3/8] Install Bitcoin Core from official binaries # [3/8] Install Bitcoin Core from official binaries
@ -61,24 +61,69 @@ apt-get install -y \
echo "[3/8] Installing official Bitcoin Core binaries…" echo "[3/8] Installing official Bitcoin Core binaries…"
BTC_VER="27.0" BTC_VER="27.0"
BTC_BASE="bitcoin-${BTC_VER}"
BTC_TAR="${BTC_BASE}-x86_64-linux-gnu.tar.gz"
BTC_URL="https://bitcoincore.org/bin/bitcoin-core-${BTC_VER}/${BTC_TAR}"
BTC_SUMS_URL="https://bitcoincore.org/bin/bitcoin-core-${BTC_VER}/SHA256SUMS"
mkdir -p /tmp/bitcoin # ===== Detect CPU arch and install correct Bitcoin Core binary =====
cd /tmp/bitcoin
echo "Downloading Bitcoin Core ${BTC_VER}…" detect_arch() {
curl -LO "${BTC_URL}" # Prefer dpkg (Debian/Ubuntu), fall back to uname
curl -LO "${BTC_SUMS_URL}" local deb_arch
deb_arch=$(dpkg --print-architecture 2>/dev/null || true)
case "$deb_arch" in
amd64) echo "x86_64-linux-gnu"; return ;;
arm64) echo "aarch64-linux-gnu"; return ;;
armhf) echo "arm-linux-gnueabihf"; return ;;
esac
echo "Verifying checksum…" # Fallback by kernel arch
grep "${BTC_TAR}" SHA256SUMS | sha256sum -c - local u
u=$(uname -m)
case "$u" in
x86_64) echo "x86_64-linux-gnu" ;;
aarch64) echo "aarch64-linux-gnu" ;;
armv7l|armv6l)
echo "arm-linux-gnueabihf" ;;
*)
echo "unsupported"
;;
esac
}
echo "Extracting…" BTC_PLAT="$(detect_arch)"
tar -xzf "${BTC_TAR}" if [ "$BTC_PLAT" = "unsupported" ]; then
install -m 0755 -o root -g root ${BTC_BASE}/bin/* /usr/local/bin/ echo "ERROR: Unsupported CPU architecture ($(uname -m))."
echo "Tip: For exotic arches, build from source using depends/ then install bitcoind/bitcoin-cli."
exit 1
fi
BASE_URL="https://bitcoincore.org/bin/bitcoin-core-$BTC_VER"
TARBALL="bitcoin-$BTC_VER-$BTC_PLAT.tar.gz"
TMPD="$(mktemp -d)"
echo "[Bitcoin Core] Detected platform: $BTC_PLAT"
echo "[Bitcoin Core] Downloading $TARBALL …"
curl -fsSL "$BASE_URL/$TARBALL" -o "$TMPD/$TARBALL"
# Get SHA256SUMS (and try to verify signature if gpg is present)
curl -fsSL "$BASE_URL/SHA256SUMS" -o "$TMPD/SHA256SUMS"
if command -v gpg >/dev/null 2>&1; then
curl -fsSL "$BASE_URL/SHA256SUMS.asc" -o "$TMPD/SHA256SUMS.asc" || true
# If youve already imported the Bitcoin Core release keys, this will verify.
# If not, we still proceed after SHA256 check below.
gpg --verify "$TMPD/SHA256SUMS.asc" "$TMPD/SHA256SUMS" || echo "[WARN] Could not verify SHA256SUMS signature (no keys?). Continuing with SHA256 check."
fi
echo "[Bitcoin Core] Verifying tarball checksum …"
( cd "$TMPD" && grep " $TARBALL" SHA256SUMS | sha256sum -c - )
echo "[Bitcoin Core] Installing to /usr/local/bin …"
tar -xzf "$TMPD/$TARBALL" -C "$TMPD"
install -m 0755 "$TMPD/bitcoin-$BTC_VER/bin/bitcoind" /usr/local/bin/
install -m 0755 "$TMPD/bitcoin-$BTC_VER/bin/bitcoin-cli" /usr/local/bin/
install -m 0755 "$TMPD/bitcoin-$BTC_VER/bin/bitcoin-tx" /usr/local/bin/
install -m 0755 "$TMPD/bitcoin-$BTC_VER/bin/bitcoin-wallet" /usr/local/bin/
rm -rf "$TMPD"
echo "[Bitcoin Core] Installed bitcoind/bitcoin-cli for $BTC_PLAT"
# systemd service for bitcoind # systemd service for bitcoind
cat > /etc/systemd/system/bitcoind.service <<EOF cat > /etc/systemd/system/bitcoind.service <<EOF