From 0d208d2f4d5f25c0dbf755238450a5b418ab727e Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Thu, 26 Mar 2026 22:44:44 +0100 Subject: [PATCH] Rework images, grouping by architectures. Building images for Pi 3 and Pi 4 families didn't make much sense since the same image can run on both (modulo possible CMA tweaks for the Compute Module 4). The same is almost true for the Pi 5 (given a sufficiently high kernel version). Let's build: - for armhf (Pi 2); - for arm64 (Pi 3, Pi 4, Pi 5). Let's forget about armel, it's no longer supported in Debian anyway. Link: https://salsa.debian.org/raspi-team/image-specs/-/issues/75 --- Makefile | 12 ++++++------ generate-recipe.py | 48 ++++++++++++++-------------------------------- 2 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index eb2714f..e4c383f 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ all: shasums # List all the supported and built Pi platforms here. They get expanded -# to names like 'raspi_2_buster.yaml' and 'raspi_3_bullseye.img.xz'. -BUILD_FAMILIES := 1 2 3 4 +# to names like 'raspi_arm64_trixie.yaml' and 'raspi_arm64_trixie.img.xz'. +BUILD_ARCHS := armhf arm64 BUILD_RELEASES := bookworm trixie forky -platforms := $(foreach plat, $(BUILD_FAMILIES),$(foreach rel, $(BUILD_RELEASES), raspi_$(plat)_$(rel))) +platforms := $(foreach plat, $(BUILD_ARCHS),$(foreach rel, $(BUILD_RELEASES), raspi_$(plat)_$(rel))) shasums: $(addsuffix .img.sha256,$(platforms)) $(addsuffix .img.xz.sha256,$(platforms)) xzimages: $(addsuffix .img.xz,$(platforms)) @@ -24,15 +24,15 @@ endif target_platforms: @echo $(platforms) -# Generate targets based on all family * release combinations: +# Generate targets based on all architecture * release combinations: define dynamic_yaml_target = raspi_$(1)_$(2).yaml: raspi_master.yaml generate-recipe.py raspi_$(1)_$(2).yaml: ./generate-recipe.py $(1) $(2) endef $(foreach release,$(BUILD_RELEASES), \ - $(foreach family,$(BUILD_FAMILIES), \ - $(eval $(call dynamic_yaml_target,$(family),$(release))))) + $(foreach arch,$(BUILD_ARCHS), \ + $(eval $(call dynamic_yaml_target,$(arch),$(release))))) %.img.sha256: %.img if [ -e $< ]; then \ diff --git a/generate-recipe.py b/generate-recipe.py index 13e965c..74f2098 100755 --- a/generate-recipe.py +++ b/generate-recipe.py @@ -13,42 +13,26 @@ if len(sys.argv) != 3: print("E: need 2 arguments", file=sys.stderr) sys.exit(1) -version = sys.argv[1] -if version not in ["1", "2", "3", "4"]: - print("E: unsupported version %s" % version, file=sys.stderr) +arch = sys.argv[1] +if arch not in ['armhf', 'arm64']: + print("E: unsupported arch %s" % arch, file=sys.stderr) sys.exit(1) suite = sys.argv[2] -if suite not in ['bullseye', 'bookworm', 'trixie', 'forky']: +if suite not in ['bookworm', 'trixie', 'forky']: print("E: unsupported suite %s" % suite, file=sys.stderr) sys.exit(1) -target_yaml = 'raspi_%s_%s.yaml' % (version, suite) - - -### Detect unsupported combinations -# -# Some version/suite combinations are no longer supported (e.g. the architecture -# got removed from the archive), in which case generate an empty file and let -# the Makefile pick it up from there. -if version == '1' and suite in ['forky']: - print(f'W: generating an empty recipe for unsupported combination ({version}×{suite})') - Path(target_yaml).write_text('') - sys.exit(0) +target_yaml = 'raspi_%s_%s.yaml' % (arch, suite) ### Setting variables based on suite and version starts here # Arch, kernel, DTB: -if version == '1': - arch = 'armel' - linux = 'linux-image-rpi' - dtb = '/usr/lib/linux-image-*-rpi/bcm*rpi-*.dtb' -elif version == '2': +if arch == 'armhf': arch = 'armhf' linux = 'linux-image-armmp' dtb = '/usr/lib/linux-image-*-armmp/bcm*rpi*.dtb' -elif version in ['3', '4']: - arch = 'arm64' +elif arch == 'arm64': linux = 'linux-image-arm64' dtb = '/usr/lib/linux-image-*-arm64/broadcom/bcm*rpi*.dtb' @@ -63,16 +47,12 @@ else: firmware_component = 'non-free' firmware_component_old = '' -# wireless firmware: -if version != '2': +# wireless/bluetooth firmware: +if arch != 'armhf': wireless_firmware = 'firmware-brcm80211' -else: - wireless_firmware = '' - -# bluetooth firmware: -if version != '2': bluetooth_firmware = 'bluez-firmware' else: + wireless_firmware = '' bluetooth_firmware = '' # Pi 4 on buster required some backports. Let's keep variables around, ready to @@ -81,20 +61,20 @@ backports_enable = False backports_suite = '%s-backports' % suite # Serial console: -if version in ['1', '2']: +if arch == 'armhf': serial = 'ttyAMA0,115200' -elif version in ['3', '4']: +elif arch == 'arm64': serial = 'ttyS1,115200' # CMA fixup: extra_chroot_shell_cmds = [] -if version == '4': +if arch == 'arm64': extra_chroot_shell_cmds = [ "sed -i 's/cma=64M //' /boot/firmware/cmdline.txt", ] # Hostname: -hostname = 'rpi_%s' % version +hostname = 'rpi-%s' % arch # Nothing yet! extra_root_shell_cmds = []