From 0a81080910cf63787fc7b491beec7acfc266ec28 Mon Sep 17 00:00:00 2001 From: xugro <82907135+xugro@users.noreply.github.com> Date: Sat, 21 Dec 2024 17:05:55 +0300 Subject: [PATCH] detect architecture and give error if running on reMarkable paper pro --- scripts/bootstrap/bootstrap | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap/bootstrap b/scripts/bootstrap/bootstrap index 15da30019..af2ded788 100755 --- a/scripts/bootstrap/bootstrap +++ b/scripts/bootstrap/bootstrap @@ -20,6 +20,27 @@ if [ -z "$BASH" ] || [[ "$(ps | awk '$1=='$$' { n=split($5,a,"/"); print a[n] }' exit 1 fi +arch="" +device="" +unam="$(uname -m)" + +if [ "$unam" = "armv7l" ]; then + arch="armv7sf-k3.2" + device="rmall" #rmall is only rm1 and rm2 to keep compatibility with older toltec versions +fi + +if [ "$unam" = "aarch64" ]; then + arch="aarch64-k3.10" + device="rmpp" + echo "The reMarkable Paper Pro is not yet supported!" + exit 1 +fi + +if [ -z "$arch" ]; then + echo "Device architecture not recognised." + exit 1 +fi + set -eEuo pipefail # Path to the temporary local wget and Opkg binaries @@ -33,8 +54,8 @@ toltecctl_path="${toltecctl_path:-/home/root/.local/bin/toltecctl}" toltec_branch="${toltec_branch:-stable}" # Base URLs for bootstrapping from the Entware and Toltec repositories -entware_remote="${entware_remote:-https://bin.entware.net/armv7sf-k3.2/installer}" -toltec_remote="${toltec_remote:-https://toltec-dev.org/$toltec_branch/rmall}" +entware_remote="${entware_remote:-https://bin.entware.net/$arch/installer}" +toltec_remote="${toltec_remote:-https://toltec-dev.org/$toltec_branch/$device}" # Remove all temporary files cleanup() {