summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2024-05-13 16:28:00 +0100
committerSerge Schneider <serge@raspberrypi.com>2024-05-13 16:28:00 +0100
commit2327c5e28dbca3f50a6975dfef779cd63e76b4ff (patch)
tree976dba7f997365e8f22bb886f1a202e41e7cb6e1 /build.sh
parent64e205739c4f3ebfa2eea697314dbfe14105cb51 (diff)
parentd87f764fcbc2e9bdbfd407d2cbf9b5faf5600df1 (diff)
Merge branch 'master' into arm64
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/build.sh b/build.sh
index 054b3f5..d094eee 100755
--- a/build.sh
+++ b/build.sh
@@ -167,10 +167,9 @@ export PI_GEN=${PI_GEN:-pi-gen}
export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen}
export PI_GEN_RELEASE=${PI_GEN_RELEASE:-Raspberry Pi reference}
-if [ -z "${IMG_NAME}" ]; then
- echo "IMG_NAME not set" 1>&2
- exit 1
-fi
+export ARCH=armhf
+export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
+export IMG_NAME="${IMG_NAME:-raspios-$RELEASE-$ARCH}"
export USE_QEMU="${USE_QEMU:-0}"
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
@@ -198,7 +197,6 @@ export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi}
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
export FIRST_USER_PASS
export DISABLE_FIRST_BOOT_USER_RENAME=${DISABLE_FIRST_BOOT_USER_RENAME:-0}
-export RELEASE=${RELEASE:-bookworm} # Don't forget to update stage0/prerun.sh
export WPA_COUNTRY
export ENABLE_SSH="${ENABLE_SSH:-0}"
export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}"
@@ -215,7 +213,6 @@ export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
export PUBKEY_SSH_FIRST_USER
export CLEAN
-export IMG_NAME
export APT_PROXY
export STAGE
@@ -247,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"