Skip to content

Commit

Permalink
Box86/64: add pagesize checking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theofficialgman committed Sep 27, 2023
1 parent 54738a5 commit b39d39c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/Box64/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
Expand Down
5 changes: 5 additions & 0 deletions apps/Box86/install-64
Original file line number Diff line number Diff line change
@@ -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")"
}
Expand Down

2 comments on commit b39d39c

@Botspot
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theofficialgman, did you intentionally leave out User error:? If that was added, the message would be displayed on the diagnosis window.

@theofficialgman
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I want to get logs of this when it happens.

Apple hardware is the only known hardware but there could be others using 16K pagesize that do have 32but support.

Please sign in to comment.