From b39d39c2774b66cb45a056ade56fefcfc62c5d9f Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:46:40 -0400 Subject: [PATCH] Box86/64: add pagesize checking error on box86 which does not support 16K pagesize and install 16K pagesize deb on box64. The only known ARM desktop system using 16K pagesize is Apple Silicon which CPUs do NOT support 32bit ARM binary execution in hardware so they can never run box86 anyway. --- apps/Box64/install-64 | 5 +++++ apps/Box86/install-64 | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/apps/Box64/install-64 b/apps/Box64/install-64 index 166f3c1089..2f140311eb 100755 --- a/apps/Box64/install-64 +++ b/apps/Box64/install-64 @@ -21,6 +21,7 @@ fi # obtain SOC_ID get_model +PAGE_SIZE="$(getconf PAGE_SIZE)" if [[ "$SOC_ID" == "tegra-x1" ]] || [[ "$SOC_ID" == "tegra-x2" ]]; then install_packages box64-tegrax1 || exit 1 elif [[ "$SOC_ID" == "rk3399" ]]; then @@ -29,6 +30,10 @@ 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 && [[ "$PAGE_SIZE" == "16384" ]]; then + warning "There is no box64 pre-build for your device $SOC_ID $model and it has a 16K pagesize" + warning "Installing the generic arm page16k box64 build as a fallback (crypto extensions enabled)" + install_packages box64-generic-arm-page16k || 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)" diff --git a/apps/Box86/install-64 b/apps/Box86/install-64 index 9b80d11919..5793572557 100755 --- a/apps/Box86/install-64 +++ b/apps/Box86/install-64 @@ -1,5 +1,10 @@ #!/bin/bash +PAGE_SIZE="$(getconf PAGE_SIZE)" +if [[ "$PAGE_SIZE" == "16384" ]]; then + error "16K pagesize not supported on box86. Check if your system supports running 32bit ARM binaries and open an issue on Box86 GitHub if it can." +fi + function check-armhf() { ARMHF="$(dpkg --print-foreign-architectures | grep "armhf")" }