summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2024-05-13 15:54:28 +0100
committerSerge Schneider <serge@raspberrypi.com>2024-05-13 16:10:11 +0100
commitd87f764fcbc2e9bdbfd407d2cbf9b5faf5600df1 (patch)
treeaeb3ef88eaeb083167a52d1b1d286b1c478bea05 /build.sh
parente95e00f879e24c0f087763ec471fb9bdf9a8f92b (diff)
build.sh: Warn user of unsupported build environment architecture and fail early if binfmt_misc isn't working as expected
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 3cb10e7..d094eee 100755
--- a/build.sh
+++ b/build.sh
@@ -244,6 +244,15 @@ fi
dependencies_check "${BASE_DIR}/depends"
+echo "Checking native $ARCH executable support..."
+if ! arch-test -n "$ARCH"; then
+ echo "WARNING: Only a native build environment is supported. Checking emulated support..."
+ if ! arch-test "$ARCH"; then
+ echo "No fallback mechanism found. Ensure your OS has binfmt_misc support enabled and configured."
+ exit 1
+ fi
+fi
+
#check username is valid
if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME"