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
This commit is contained in:
12
Makefile
12
Makefile
@@ -1,11 +1,11 @@
|
|||||||
all: shasums
|
all: shasums
|
||||||
|
|
||||||
# List all the supported and built Pi platforms here. They get expanded
|
# 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'.
|
# to names like 'raspi_arm64_trixie.yaml' and 'raspi_arm64_trixie.img.xz'.
|
||||||
BUILD_FAMILIES := 1 2 3 4
|
BUILD_ARCHS := armhf arm64
|
||||||
BUILD_RELEASES := bookworm trixie forky
|
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))
|
shasums: $(addsuffix .img.sha256,$(platforms)) $(addsuffix .img.xz.sha256,$(platforms))
|
||||||
xzimages: $(addsuffix .img.xz,$(platforms))
|
xzimages: $(addsuffix .img.xz,$(platforms))
|
||||||
@@ -24,15 +24,15 @@ endif
|
|||||||
target_platforms:
|
target_platforms:
|
||||||
@echo $(platforms)
|
@echo $(platforms)
|
||||||
|
|
||||||
# Generate targets based on all family * release combinations:
|
# Generate targets based on all architecture * release combinations:
|
||||||
define dynamic_yaml_target =
|
define dynamic_yaml_target =
|
||||||
raspi_$(1)_$(2).yaml: raspi_master.yaml generate-recipe.py
|
raspi_$(1)_$(2).yaml: raspi_master.yaml generate-recipe.py
|
||||||
raspi_$(1)_$(2).yaml:
|
raspi_$(1)_$(2).yaml:
|
||||||
./generate-recipe.py $(1) $(2)
|
./generate-recipe.py $(1) $(2)
|
||||||
endef
|
endef
|
||||||
$(foreach release,$(BUILD_RELEASES), \
|
$(foreach release,$(BUILD_RELEASES), \
|
||||||
$(foreach family,$(BUILD_FAMILIES), \
|
$(foreach arch,$(BUILD_ARCHS), \
|
||||||
$(eval $(call dynamic_yaml_target,$(family),$(release)))))
|
$(eval $(call dynamic_yaml_target,$(arch),$(release)))))
|
||||||
|
|
||||||
%.img.sha256: %.img
|
%.img.sha256: %.img
|
||||||
if [ -e $< ]; then \
|
if [ -e $< ]; then \
|
||||||
|
|||||||
@@ -13,42 +13,26 @@ if len(sys.argv) != 3:
|
|||||||
print("E: need 2 arguments", file=sys.stderr)
|
print("E: need 2 arguments", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
version = sys.argv[1]
|
arch = sys.argv[1]
|
||||||
if version not in ["1", "2", "3", "4"]:
|
if arch not in ['armhf', 'arm64']:
|
||||||
print("E: unsupported version %s" % version, file=sys.stderr)
|
print("E: unsupported arch %s" % arch, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
suite = sys.argv[2]
|
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)
|
print("E: unsupported suite %s" % suite, file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
target_yaml = 'raspi_%s_%s.yaml' % (version, suite)
|
target_yaml = 'raspi_%s_%s.yaml' % (arch, 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)
|
|
||||||
|
|
||||||
|
|
||||||
### Setting variables based on suite and version starts here
|
### Setting variables based on suite and version starts here
|
||||||
|
|
||||||
# Arch, kernel, DTB:
|
# Arch, kernel, DTB:
|
||||||
if version == '1':
|
if arch == 'armhf':
|
||||||
arch = 'armel'
|
|
||||||
linux = 'linux-image-rpi'
|
|
||||||
dtb = '/usr/lib/linux-image-*-rpi/bcm*rpi-*.dtb'
|
|
||||||
elif version == '2':
|
|
||||||
arch = 'armhf'
|
arch = 'armhf'
|
||||||
linux = 'linux-image-armmp'
|
linux = 'linux-image-armmp'
|
||||||
dtb = '/usr/lib/linux-image-*-armmp/bcm*rpi*.dtb'
|
dtb = '/usr/lib/linux-image-*-armmp/bcm*rpi*.dtb'
|
||||||
elif version in ['3', '4']:
|
elif arch == 'arm64':
|
||||||
arch = 'arm64'
|
|
||||||
linux = 'linux-image-arm64'
|
linux = 'linux-image-arm64'
|
||||||
dtb = '/usr/lib/linux-image-*-arm64/broadcom/bcm*rpi*.dtb'
|
dtb = '/usr/lib/linux-image-*-arm64/broadcom/bcm*rpi*.dtb'
|
||||||
|
|
||||||
@@ -63,16 +47,12 @@ else:
|
|||||||
firmware_component = 'non-free'
|
firmware_component = 'non-free'
|
||||||
firmware_component_old = ''
|
firmware_component_old = ''
|
||||||
|
|
||||||
# wireless firmware:
|
# wireless/bluetooth firmware:
|
||||||
if version != '2':
|
if arch != 'armhf':
|
||||||
wireless_firmware = 'firmware-brcm80211'
|
wireless_firmware = 'firmware-brcm80211'
|
||||||
else:
|
|
||||||
wireless_firmware = ''
|
|
||||||
|
|
||||||
# bluetooth firmware:
|
|
||||||
if version != '2':
|
|
||||||
bluetooth_firmware = 'bluez-firmware'
|
bluetooth_firmware = 'bluez-firmware'
|
||||||
else:
|
else:
|
||||||
|
wireless_firmware = ''
|
||||||
bluetooth_firmware = ''
|
bluetooth_firmware = ''
|
||||||
|
|
||||||
# Pi 4 on buster required some backports. Let's keep variables around, ready to
|
# 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
|
backports_suite = '%s-backports' % suite
|
||||||
|
|
||||||
# Serial console:
|
# Serial console:
|
||||||
if version in ['1', '2']:
|
if arch == 'armhf':
|
||||||
serial = 'ttyAMA0,115200'
|
serial = 'ttyAMA0,115200'
|
||||||
elif version in ['3', '4']:
|
elif arch == 'arm64':
|
||||||
serial = 'ttyS1,115200'
|
serial = 'ttyS1,115200'
|
||||||
|
|
||||||
# CMA fixup:
|
# CMA fixup:
|
||||||
extra_chroot_shell_cmds = []
|
extra_chroot_shell_cmds = []
|
||||||
if version == '4':
|
if arch == 'arm64':
|
||||||
extra_chroot_shell_cmds = [
|
extra_chroot_shell_cmds = [
|
||||||
"sed -i 's/cma=64M //' /boot/firmware/cmdline.txt",
|
"sed -i 's/cma=64M //' /boot/firmware/cmdline.txt",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Hostname:
|
# Hostname:
|
||||||
hostname = 'rpi_%s' % version
|
hostname = 'rpi-%s' % arch
|
||||||
|
|
||||||
# Nothing yet!
|
# Nothing yet!
|
||||||
extra_root_shell_cmds = []
|
extra_root_shell_cmds = []
|
||||||
|
|||||||
Reference in New Issue
Block a user