For Bookworm, use the new non-free-firmware section instead of non-free

This commit is contained in:
Gunnar Wolf 2022-10-12 10:25:53 -05:00
parent 1211f8af04
commit 1ffce8e6bb
2 changed files with 22 additions and 8 deletions

View File

@ -50,6 +50,19 @@ else:
raspi_firmware = 'raspi-firmware' raspi_firmware = 'raspi-firmware'
fix_firmware = False fix_firmware = False
# Bookworm introduced the 'non-free-firmware' component¹; before that,
# raspi-firmware was in 'non-free'
#
# ¹ https://www.debian.org/vote/2022/vote_003
if suite == 'bookworm':
firmware_component = 'non-free-firmware'
else:
# We only need "non-free". "Contrib" was before included as well,
# as they are usually enabled together, but adding a second YAML
# element... makes the resulting code ugly and brittle. Besides,
# we don't use anything from contrib!
firmware_component = 'non-free'
# Extra wireless firmware: # Extra wireless firmware:
if version != '2': if version != '2':
wireless_firmware = 'firmware-brcm80211' wireless_firmware = 'firmware-brcm80211'
@ -108,14 +121,15 @@ else:
if backports_enable: if backports_enable:
backports_stanza = """ backports_stanza = """
%s %s
deb http://deb.debian.org/debian/ %s main contrib non-free deb http://deb.debian.org/debian/ %s main %s
""" % (backports_enable, backports_suite) """ % (backports_enable, backports_suite, firmware_component)
else: else:
# ugh
backports_stanza = """ backports_stanza = """
# Backports are _not_ enabled by default. # Backports are _not_ enabled by default.
# Enable them by uncommenting the following line: # Enable them by uncommenting the following line:
# deb http://deb.debian.org/debian %s main contrib non-free # deb http://deb.debian.org/debian %s main %s
""" % backports_suite """ % (backports_suite, firmware_component)
# Buster requires an existing, empty /etc/machine-id file: # Buster requires an existing, empty /etc/machine-id file:
if suite == 'buster': if suite == 'buster':
@ -159,6 +173,7 @@ with open('raspi_master.yaml', 'r') as in_file:
out_text = in_text \ out_text = in_text \
.replace('__RELEASE__', suite) \ .replace('__RELEASE__', suite) \
.replace('__ARCH__', arch) \ .replace('__ARCH__', arch) \
.replace('__FIRMWARE_COMPONENT__', firmware_component) \
.replace('__LINUX_IMAGE__', linux) \ .replace('__LINUX_IMAGE__', linux) \
.replace('__DTB__', dtb) \ .replace('__DTB__', dtb) \
.replace('__SECURITY_SUITE__', security_suite) \ .replace('__SECURITY_SUITE__', security_suite) \

View File

@ -45,14 +45,13 @@ steps:
arch: __ARCH__ arch: __ARCH__
components: components:
- main - main
- contrib - __FIRMWARE_COMPONENT__
- non-free
unless: rootfs_unpacked unless: rootfs_unpacked
- create-file: /etc/apt/sources.list - create-file: /etc/apt/sources.list
contents: |+ contents: |+
deb http://deb.debian.org/debian __RELEASE__ main contrib non-free deb http://deb.debian.org/debian __RELEASE__ main __FIRMWARE_COMPONENT__
deb http://security.debian.org/debian-security __SECURITY_SUITE__ main contrib non-free deb http://security.debian.org/debian-security __SECURITY_SUITE__ main __FIRMWARE_COMPONENT__
__BACKPORTS__ __BACKPORTS__
unless: rootfs_unpacked unless: rootfs_unpacked