summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2024-10-30 10:08:48 +0000
committerSerge Schneider <serge@raspberrypi.com>2024-10-30 10:12:21 +0000
commit1baee51b8cf7cd1e8e52dbe89171efccc0993200 (patch)
tree7d98c3a16c7bc8e81d359f40e8c6d74414349f0d
parentdf6d0e2a25d920aa32f8f90fe7662ba8b98d2e4a (diff)
Improve PAGESIZE check and recommendation
Setting kernel=kernel8.img while auto_initramfs=1 currently still loads initamfs_2712. This can cause issues on systems which require drivers compiled as modules to boot. Until this is fixed in the bootloader, users should specify initramfs options as well. Also, move the PAGESIZE check before the arch-test checks to make the output clearer.
-rwxr-xr-xbuild.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index c33abf4..f35da03 100755
--- a/build.sh
+++ b/build.sh
@@ -255,18 +255,24 @@ trap term EXIT INT TERM
dependencies_check "${BASE_DIR}/depends"
+
+PAGESIZE=$(getconf PAGESIZE)
+if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
+ echo
+ echo "ERROR: Building an $ARCH image requires a kernel with a 4k page size (current: $PAGESIZE)"
+ echo "On Raspberry Pi OS (64-bit), you can switch to a suitable kernel by adding the following to /boot/firmware/config.txt and rebooting:"
+ echo
+ echo "kernel=kernel8.img"
+ echo "initramfs initramfs8 followkernel"
+ echo
+ exit 1
+fi
+
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."
- PAGESIZE=$(getconf PAGESIZE)
- if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
- echo
- echo "Building an $ARCH image requires a kernel with a 4k page size"
- echo "Current pagesize: $PAGESIZE"
- echo "On Raspberry Pi OS, you can switch to a suitable kernel by adding kernel=kernel8.img to /boot/firmware/config.txt and rebooting"
- fi
exit 1
fi
fi