From 1baee51b8cf7cd1e8e52dbe89171efccc0993200 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 30 Oct 2024 10:08:48 +0000 Subject: [PATCH 1/3] 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. --- build.sh | 20 +++++++++++++------- 1 file 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 From 536dd583b4eeef13c3a44964aab53cbc80d9b874 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 30 Oct 2024 11:32:47 +0000 Subject: [PATCH 2/3] README.md: Clarify early on that armhf and arm64 images should be build from different branches. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a246b5f..51cd422 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ which was in turn derived from the Raspbian project. **Note**: Raspberry Pi OS 32 bit images are based primarily on Raspbian, while Raspberry Pi OS 64 bit images are based primarily on Debian. +**Note**: 32 bit images should be built from the `master` branch. +64 bit images should be built from the `arm64` branch. + ## Dependencies pi-gen runs on Debian-based operating systems released after 2017, and we From 9dbd88221cdc7fa074242eca580d367758fd9023 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 30 Oct 2024 11:33:11 +0000 Subject: [PATCH 3/3] README.md: Fix TIMEZONE_DEFAULT description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51cd422..e40fc26 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ The following environment variables are supported: * `TIMEZONE_DEFAULT` (Default: 'Europe/London' ) - Default keyboard layout. + Default time zone. To get the current value from a running system, look in `/etc/timezone`.