Skip to content

Commit 1baee51

Browse files
committed
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.
1 parent df6d0e2 commit 1baee51

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

build.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,24 @@ trap term EXIT INT TERM
255255

256256
dependencies_check "${BASE_DIR}/depends"
257257

258+
259+
PAGESIZE=$(getconf PAGESIZE)
260+
if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
261+
echo
262+
echo "ERROR: Building an $ARCH image requires a kernel with a 4k page size (current: $PAGESIZE)"
263+
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:"
264+
echo
265+
echo "kernel=kernel8.img"
266+
echo "initramfs initramfs8 followkernel"
267+
echo
268+
exit 1
269+
fi
270+
258271
echo "Checking native $ARCH executable support..."
259272
if ! arch-test -n "$ARCH"; then
260273
echo "WARNING: Only a native build environment is supported. Checking emulated support..."
261274
if ! arch-test "$ARCH"; then
262275
echo "No fallback mechanism found. Ensure your OS has binfmt_misc support enabled and configured."
263-
PAGESIZE=$(getconf PAGESIZE)
264-
if [ "$ARCH" == "armhf" ] && [ "$PAGESIZE" != "4096" ]; then
265-
echo
266-
echo "Building an $ARCH image requires a kernel with a 4k page size"
267-
echo "Current pagesize: $PAGESIZE"
268-
echo "On Raspberry Pi OS, you can switch to a suitable kernel by adding kernel=kernel8.img to /boot/firmware/config.txt and rebooting"
269-
fi
270276
exit 1
271277
fi
272278
fi

0 commit comments

Comments
 (0)